diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-09-17 12:54:39 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-09-17 12:54:39 -0700 |
commit | 2762db8408dbc2032f0c253234cc382580d8fad3 (patch) | |
tree | a6523877893aaefd2209ea3d63f8c7c60a98d238 /node | |
parent | edff13dcae3c316f7a454fcd3b415c0ef2e4002c (diff) | |
download | infinitytier-2762db8408dbc2032f0c253234cc382580d8fad3.tar.gz infinitytier-2762db8408dbc2032f0c253234cc382580d8fad3.zip |
More work on control bus refactor...
Diffstat (limited to 'node')
-rw-r--r-- | node/Node.cpp | 6 | ||||
-rw-r--r-- | node/Topology.hpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index 36a199b9..2cc37749 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -777,7 +777,7 @@ void Node::status(ZT1_Node_Status *status) GatherPeerStatistics gps; gps.now = Utils::now(); gps.status = status; - _r->topology->eachPeer(gps); + _r->topology->eachPeer<GatherPeerStatistics &>(gps); if (status->alivePeers > 0) { double dlsr = (double)status->directlyConnectedPeers / (double)status->alivePeers; @@ -793,7 +793,7 @@ void Node::status(ZT1_Node_Status *status) struct CollectPeersAndPaths { std::vector< std::pair< SharedPtr<Peer>,std::vector<Path> > > data; - inline void operator()(Topology &t,const SharedPtr<Peer> &p) { data.push_back(std::pair< SharedPtr<Peer>,std::vector<Path> >(p,p->paths())); } + inline void operator()(Topology &t,const SharedPtr<Peer> &p) { this->data.push_back(std::pair< SharedPtr<Peer>,std::vector<Path> >(p,p->paths())); } }; struct SortPeersAndPathsInAscendingAddressOrder { @@ -806,7 +806,7 @@ ZT1_Node_PeerList *Node::listPeers() RuntimeEnvironment *_r = (RuntimeEnvironment *)&(impl->renv); CollectPeersAndPaths pp; - _r->topology->eachPeer(pp); + _r->topology->eachPeer<CollectPeersAndPaths &>(pp); std::sort(pp.data.begin(),pp.data.end(),SortPeersAndPathsInAscendingAddressOrder()); unsigned int returnBufSize = sizeof(ZT1_Node_PeerList); diff --git a/node/Topology.hpp b/node/Topology.hpp index 6bbbc297..ccf88c5c 100644 --- a/node/Topology.hpp +++ b/node/Topology.hpp @@ -191,6 +191,9 @@ public: /** * Apply a function or function object to all peers * + * Note: explicitly template this by reference if you want the object + * passed by reference instead of copied. + * * @param f Function to apply * @tparam F Function or function object type */ @@ -205,6 +208,9 @@ public: /** * Apply a function or function object to all supernode peers * + * Note: explicitly template this by reference if you want the object + * passed by reference instead of copied. + * * @param f Function to apply * @tparam F Function or function object type */ |