]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/other/smux/sensors.cpp
7721d7b7dc3831a4889bb6225992d8e29c9cf18c
[stg.git] / projects / stargazer / plugins / other / smux / sensors.cpp
1 #include "stg/INTEGER.h"
2
3 #include "stg/user.h"
4
5 #include "sensors.h"
6
7 bool UsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const
8 {
9 int handle = users.OpenSearch();
10 if (!handle)
11     return false;
12
13 USER_PTR user;
14 size_t count = 0;
15 while (!users.SearchNext(handle, &user))
16     {
17     if (UserPredicate(user))
18         ++count;
19     }
20
21 users.CloseSearch(handle);
22
23 ValueToOS(count, objectSyntax);
24 return true;
25 }