Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
DefaultNode.hxx
Go to the documentation of this file.
1
35#ifndef _OPENLCB_DEFAULTNODE_HXX_
36#define _OPENLCB_DEFAULTNODE_HXX_
37
38#include "openlcb/Node.hxx"
39
40namespace openlcb
41{
42
45class DefaultNode: public Node
46{
47public:
52 DefaultNode(If* iface, NodeID node_id, bool init = true);
53
55 virtual ~DefaultNode();
56
57 NodeID node_id() OVERRIDE
58 {
59 return nodeId_;
60 }
61 If* iface() OVERRIDE
62 {
63 return iface_;
64 }
66 {
67 return isInitialized_;
68 }
69
70 // Sets the initialized status to true.
72 {
74 }
75
76 // Used for restarting the stack.
78 {
80 }
81
82private:
86 unsigned isInitialized_ : 1;
89};
90
91} // namespace openlcb
92
93#endif // _OPENLCB_DEFAULTNODE_HXX_
Trivial implementation of a virtual Node.
bool is_initialized() OVERRIDE
virtual ~DefaultNode()
Destructor.
void clear_initialized() OVERRIDE
Callback from the simple stack when the node has to return to uninitialized state.
If * iface_
Interface this node is bound to.
void set_initialized() OVERRIDE
Callback from the node initialization flow when the node finished initialization.
NodeID nodeId_
48-bit node identifier of this node.
unsigned isInitialized_
1 if the node has reached initialized state.
Abstract class representing an OpenLCB Interface.
Definition If.hxx:185
Base class for NMRAnet nodes conforming to the asynchronous interface.
Definition Node.hxx:52
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
Definition macros.h:180
uint64_t NodeID
48-bit NMRAnet Node ID type