Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Node.hxx
Go to the documentation of this file.
1
35#ifndef _OPENLCB_NODE_HXX_
36#define _OPENLCB_NODE_HXX_
37
38#include "openlcb/Defs.hxx" // for NodeID
39
40namespace openlcb
41{
42
43class If;
44
51class Node
52{
53public:
54 virtual ~Node() {}
55 // @returns the 48-bit NMRAnet node id for this node.
56 virtual NodeID node_id() = 0;
57 // @returns the interface this virtual node is bound to.
58 virtual If* iface() = 0;
62 virtual bool is_initialized() = 0;
63
67 virtual void set_initialized() {}
68
71 virtual void clear_initialized() = 0;
72
74 void initialize();
75};
76
77} // namespace openlcb
78
79#endif // _OPENLCB_NODE_HXX_
Abstract class representing an OpenLCB Interface.
Definition If.hxx:185
Base class for NMRAnet nodes conforming to the asynchronous interface.
Definition Node.hxx:52
virtual bool is_initialized()=0
virtual void clear_initialized()=0
Callback from the simple stack when the node has to return to uninitialized state.
void initialize()
Callback from the simple stack to start the initialization process.
virtual void set_initialized()
Callback from the node initialization flow when the node finished initialization.
Definition Node.hxx:67
uint64_t NodeID
48-bit NMRAnet Node ID type