diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-01-12 11:04:35 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-01-12 11:04:35 -0800 |
| commit | 83ef98a9dc4fb3c40a15a7fe2b5642355e4c4142 (patch) | |
| tree | f5b720dfed4f281946d24cd678bab4a72e062c84 /node/Network.hpp | |
| parent | 3edfbfec93d2f51b6f06e77e36e0d5b3b0421bf2 (diff) | |
| download | infinitytier-83ef98a9dc4fb3c40a15a7fe2b5642355e4c4142.tar.gz infinitytier-83ef98a9dc4fb3c40a15a7fe2b5642355e4c4142.zip | |
Add a network-associated user ptr in API.
Diffstat (limited to 'node/Network.hpp')
| -rw-r--r-- | node/Network.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<MulticastGroup> _allMulticastGroups() const; const RuntimeEnvironment *RR; + void *_uptr; uint64_t _id; MAC _mac; // local MAC address volatile bool _enabled; |
