diff options
Diffstat (limited to 'controller/JSONDB.hpp')
| -rw-r--r-- | controller/JSONDB.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/controller/JSONDB.hpp b/controller/JSONDB.hpp index ba16d97b..530f9632 100644 --- a/controller/JSONDB.hpp +++ b/controller/JSONDB.hpp @@ -107,6 +107,19 @@ public: } } + template<typename F> + inline void eachId(F func) + { + Mutex::Lock _l(_networks_m); + for(std::unordered_map<uint64_t,_NW>::const_iterator i(_networks.begin());i!=_networks.end();++i) { + for(std::unordered_map< uint64_t,std::vector<uint8_t> >::const_iterator m(i->second.members.begin());m!=i->second.members.end();++m) { + try { + func(i->first,m->first); + } catch ( ... ) {} + } + } + } + void threadMain() throw(); |
