summaryrefslogtreecommitdiff
path: root/controller/JSONDB.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-05-01 13:21:26 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-05-01 13:21:26 -0700
commit718e1d6c082453bfbab8b900f5ffde42047fc814 (patch)
treebd344066a515f2f195093dda6e84b9530d686006 /controller/JSONDB.hpp
parenta9ce77358484e41cd6bac42594e4eeb045a788cb (diff)
downloadinfinitytier-718e1d6c082453bfbab8b900f5ffde42047fc814.tar.gz
infinitytier-718e1d6c082453bfbab8b900f5ffde42047fc814.zip
Finish removing constantly changing stuff from controller.
Diffstat (limited to 'controller/JSONDB.hpp')
-rw-r--r--controller/JSONDB.hpp13
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();