3 #include "stg/INTEGER.h"
9 bool UsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const
11 int handle = users.OpenSearch();
12 assert(handle && "USERS::OpenSearch is always correct");
16 while (!users.SearchNext(handle, &user))
18 if (UserPredicate(user))
22 users.CloseSearch(handle);
24 ValueToOS(count, objectSyntax);
29 std::string UsersSensor::ToString() const
31 int handle = users.OpenSearch();
32 assert(handle && "USERS::OpenSearch is always correct");
36 while (!users.SearchNext(handle, &user))
38 if (UserPredicate(user))
42 users.CloseSearch(handle);
44 return std::to_string(count);
48 bool ActiveUsersSensor::UserPredicate(STG::User* userPtr) const
50 if (!userPtr->GetConnected())
52 for (size_t i = 0; i < DIR_NUM; ++i)
54 if (userPtr->GetSessionUpload()[i] > 0 ||
55 userPtr->GetSessionDownload()[i] > 0)