From 83ef98a9dc4fb3c40a15a7fe2b5642355e4c4142 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 12 Jan 2016 11:04:35 -0800 Subject: Add a network-associated user ptr in API. --- node/Network.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 0effa8e2..2bd6a7c7 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -80,8 +80,9 @@ public: * * @param renv Runtime environment * @param nwid Network ID + * @param uptr Arbitrary pointer used by externally-facing API (for user use) */ - Network(const RuntimeEnvironment *renv,uint64_t nwid); + Network(const RuntimeEnvironment *renv,uint64_t nwid,void *uptr); ~Network(); @@ -331,6 +332,11 @@ public: */ void destroy(); + /** + * @return User ptr + */ + inline void *userPtr() const throw() { return _uptr; } + inline bool operator==(const Network &n) const throw() { return (_id == n._id); } inline bool operator!=(const Network &n) const throw() { return (_id != n._id); } inline bool operator<(const Network &n) const throw() { return (_id < n._id); } @@ -348,6 +354,7 @@ private: std::vector _allMulticastGroups() const; const RuntimeEnvironment *RR; + void *_uptr; uint64_t _id; MAC _mac; // local MAC address volatile bool _enabled; -- cgit v1.2.3