summaryrefslogtreecommitdiff
path: root/controller/JSONDB.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-07-14 14:33:36 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-07-14 14:33:36 -0700
commitd9552fb1203cd3abd9d15d9565f6d42e56058d30 (patch)
tree7b8c384e96e406d47488aea896d02a209e09011e /controller/JSONDB.hpp
parent4ecc0c59cafac54ff2d32e97b130f83b7481da2e (diff)
downloadinfinitytier-d9552fb1203cd3abd9d15d9565f6d42e56058d30.tar.gz
infinitytier-d9552fb1203cd3abd9d15d9565f6d42e56058d30.zip
Add remoteTraceTarget to network and member configs in controller.
Diffstat (limited to 'controller/JSONDB.hpp')
-rw-r--r--controller/JSONDB.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/controller/JSONDB.hpp b/controller/JSONDB.hpp
index e164a14e..99b69ba2 100644
--- a/controller/JSONDB.hpp
+++ b/controller/JSONDB.hpp
@@ -29,6 +29,7 @@
#include <vector>
#include <algorithm>
#include <unordered_map>
+#include <unordered_set>
#include "../node/Constants.hpp"
#include "../node/Utils.hpp"
@@ -129,6 +130,17 @@ public:
}
}
+ inline std::vector<uint64_t> networksForMember(const uint64_t nodeId)
+ {
+ Mutex::Lock _l(_networks_m);
+ std::unordered_map< uint64_t,std::unordered_set< uint64_t > >::const_iterator m(_members.find(nodeId));
+ if (m != _members.end()) {
+ return std::vector<uint64_t>(m->second.begin(),m->second.end());
+ } else {
+ return std::vector<uint64_t>();
+ }
+ }
+
void threadMain()
throw();
@@ -154,7 +166,8 @@ private:
std::unordered_map< uint64_t,std::vector<uint8_t> > members;
};
- std::unordered_map<uint64_t,_NW> _networks;
+ std::unordered_map< uint64_t,_NW > _networks;
+ std::unordered_map< uint64_t,std::unordered_set< uint64_t > > _members;
Mutex _networks_m;
};