Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
NodeBrowser.hxx
Go to the documentation of this file.
1
34#ifndef _OPENLCB_NODEBROWSER_HXX_
35#define _OPENLCB_NODEBROWSER_HXX_
36
37#include <functional>
38
39#include "openlcb/If.hxx"
40
41namespace openlcb
42{
43
47{
48public:
52 typedef std::function<void(NodeID n)> CallbackFunction;
53
60
64
67 void refresh();
68
69private:
73 {
74 public:
78 void send(Buffer<GenMessage> *b, unsigned) override;
79
80 private:
83 };
84 friend class VerifiedHandler;
85
87 void register_callbacks();
96};
97
98} // namespace openlcb
99
100#endif // _OPENLCB_NODEBROWSER_HXX_
Base class for all QMember types that hold data in an expandable format.
Definition Buffer.hxx:195
Helper class to register in the dispatcher.
NodeBrowser * parent_
NodeBrowser that owns *this.
void send(Buffer< GenMessage > *b, unsigned) override
This class helps establishing a list of all (live) nodes on the network.
void refresh()
Requests a pong from every live node.
CallbackFunction callback_
Client callback for live or new nodes.
std::function< void(NodeID n)> CallbackFunction
Function prototype for the callback.
Node * node_
Me-node.
~NodeBrowser()
Destructor.
VerifiedHandler handler_
Callback registerd in the interface.
void unregister_callbacks()
Remove callbacks from the interface.
void register_callbacks()
Register with the interface for messages we want to listen to.
Base class for NMRAnet nodes conforming to the asynchronous interface.
Definition Node.hxx:52
uint64_t NodeID
48-bit NMRAnet Node ID type