Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::TrainNodeForProxy Class Reference

Train node class with a an OpenLCB Node ID from the DCC pool. Used for command stations. More...

#include <TractionTrain.hxx>

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

Public Member Functions

 TrainNodeForProxy (TrainService *service, TrainImpl *train)
 Constructor.
 
 ~TrainNodeForProxy ()
 Destructor.
 
NodeID node_id () OVERRIDE
 
- Public Member Functions inherited from openlcb::DefaultTrainNode
 DefaultTrainNode (TrainService *service, TrainImpl *impl)
 
NodeHandle get_controller () override
 
void set_controller (NodeHandle id) override
 
Ififace () override
 
bool is_initialized () override
 
void set_initialized () override
 Callback from the node initialization flow when the node finished initialization.
 
void clear_initialized () override
 Callback from the simple stack when the node has to return to uninitialized state.
 
TrainImpltrain () override
 
- Public Member Functions inherited from openlcb::TrainNodeWithConsist
bool function_policy (NodeHandle src, uint8_t command_byte, uint32_t fnum, uint16_t value, Notifiable *done) override
 Applies a policy to function change requests coming in from the OpenLCB bus.
 
void command_hook (NodeHandle src, const Payload &p) override
 Invoked for every incoming traction command targeted to this node.
 
bool add_consist (NodeID tgt, uint8_t flags) override
 Adds a node ID to the consist targets.
 
bool remove_consist (NodeID tgt) override
 Removes a node ID from the consist targets.
 
NodeID query_consist (int id, uint8_t *flags) override
 Returns the consist target with offset id, or NodeID(0) if there are fewer than id consist targets.
 
int query_consist_length () override
 Returns the number of slaves in this consist.
 
- Public Member Functions inherited from openlcb::Node
void initialize ()
 Callback from the simple stack to start the initialization process.
 

Additional Inherited Members

- Public Attributes inherited from openlcb::TrainNodeWithConsist
TypedQueue< ConsistEntryconsistSlaves_
 
- Protected Attributes inherited from openlcb::DefaultTrainNode
TrainServiceservice_
 Pointer to the traction service.
 
TrainImpltrain_
 Pointer to the train implementation object.
 

Detailed Description

Train node class with a an OpenLCB Node ID from the DCC pool. Used for command stations.

Definition at line 309 of file TractionTrain.hxx.

Constructor & Destructor Documentation

◆ TrainNodeForProxy()

openlcb::TrainNodeForProxy::TrainNodeForProxy ( TrainService service,
TrainImpl train 
)

Constructor.

Parameters
servicethe traction service object that will own this node.
trainthe implementation object that the traction messages should be forwarded to.

Definition at line 69 of file TractionTrain.cxx.

◆ ~TrainNodeForProxy()

openlcb::TrainNodeForProxy::~TrainNodeForProxy ( )

Destructor.

Todo:
enable this line of code. It currently breaks unit tests due to bugs

Definition at line 75 of file TractionTrain.cxx.

Member Function Documentation

◆ node_id()

NodeID openlcb::TrainNodeForProxy::node_id ( )
virtual
Returns
the OpenLCB node ID, generated from the legacy protocol types that we get from TrainImpl.

Implements openlcb::Node.

Definition at line 97 of file TractionTrain.cxx.


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