From d9552fb1203cd3abd9d15d9565f6d42e56058d30 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 14 Jul 2017 14:33:36 -0700 Subject: Add remoteTraceTarget to network and member configs in controller. --- controller/JSONDB.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'controller/JSONDB.hpp') 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 #include #include +#include #include "../node/Constants.hpp" #include "../node/Utils.hpp" @@ -129,6 +130,17 @@ public: } } + inline std::vector 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(m->second.begin(),m->second.end()); + } else { + return std::vector(); + } + } + void threadMain() throw(); @@ -154,7 +166,8 @@ private: std::unordered_map< uint64_t,std::vector > members; }; - std::unordered_map _networks; + std::unordered_map< uint64_t,_NW > _networks; + std::unordered_map< uint64_t,std::unordered_set< uint64_t > > _members; Mutex _networks_m; }; -- cgit v1.2.3