Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::Node Class Referenceabstract

Base class for NMRAnet nodes conforming to the asynchronous interface. More...

#include <Node.hxx>

Inheritance diagram for openlcb::Node:
openlcb::DefaultNode openlcb::TrainNode openlcb::TrainNodeWithConsist openlcb::DefaultTrainNode openlcb::TrainNodeForProxy openlcb::TrainNodeWithId

Public Member Functions

virtual NodeID node_id ()=0
 
virtual Ififace ()=0
 
virtual bool is_initialized ()=0
 
virtual void set_initialized ()
 Callback from the node initialization flow when the node finished initialization.
 
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.
 

Detailed Description

Base class for NMRAnet nodes conforming to the asynchronous interface.

It is important for this interface to contain no data members, since certain implementations might need to be very lightweight (e.g. a command station might have hundreds of train nodes.)

Definition at line 51 of file Node.hxx.

Constructor & Destructor Documentation

◆ ~Node()

virtual openlcb::Node::~Node ( )
inlinevirtual

Definition at line 54 of file Node.hxx.

Member Function Documentation

◆ clear_initialized()

virtual void openlcb::Node::clear_initialized ( )
pure virtual

Callback from the simple stack when the node has to return to uninitialized state.

Implemented in openlcb::DefaultNode, and openlcb::DefaultTrainNode.

◆ initialize()

void Node::initialize ( )

Callback from the simple stack to start the initialization process.

Definition at line 42 of file openlcb/Node.cxx.

◆ is_initialized()

virtual bool openlcb::Node::is_initialized ( )
pure virtual
Returns
true if the node is in the initialized state.

Nodes not in initialized state may not send traffic to the bus.

Implemented in openlcb::DefaultNode, and openlcb::DefaultTrainNode.

◆ node_id()

virtual NodeID openlcb::Node::node_id ( )
pure virtual

◆ set_initialized()

virtual void openlcb::Node::set_initialized ( )
inlinevirtual

Callback from the node initialization flow when the node finished initialization.

Nodes are not required to implement if they are not using NodeInitializationFlow.

Reimplemented in openlcb::DefaultNode, and openlcb::DefaultTrainNode.

Definition at line 67 of file Node.hxx.


The documentation for this class was generated from the following files: