From 718e1d6c082453bfbab8b900f5ffde42047fc814 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 1 May 2017 13:21:26 -0700 Subject: Finish removing constantly changing stuff from controller. --- controller/JSONDB.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'controller/JSONDB.hpp') 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 + inline void eachId(F func) + { + Mutex::Lock _l(_networks_m); + for(std::unordered_map::const_iterator i(_networks.begin());i!=_networks.end();++i) { + for(std::unordered_map< uint64_t,std::vector >::const_iterator m(i->second.members.begin());m!=i->second.members.end();++m) { + try { + func(i->first,m->first); + } catch ( ... ) {} + } + } + } + void threadMain() throw(); -- cgit v1.2.3