diff options
Diffstat (limited to 'controller/JSONDB.hpp')
-rw-r--r-- | controller/JSONDB.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/controller/JSONDB.hpp b/controller/JSONDB.hpp index 530f9632..e164a14e 100644 --- a/controller/JSONDB.hpp +++ b/controller/JSONDB.hpp @@ -93,6 +93,15 @@ public: return r; } + inline unsigned long memberCount(const uint64_t networkId) + { + Mutex::Lock _l(_networks_m); + std::unordered_map<uint64_t,_NW>::const_iterator i(_networks.find(networkId)); + if (i != _networks.end()) + return (unsigned long)i->second.members.size(); + return 0; + } + template<typename F> inline void eachMember(const uint64_t networkId,F func) { |