|
Open Model Railroad Network (OpenMRN)
|
Default implementation of a train node. More...
#include <TractionTrain.hxx>
Public Member Functions | |
| DefaultTrainNode (TrainService *service, TrainImpl *impl) | |
| NodeHandle | get_controller () override |
| void | set_controller (NodeHandle id) override |
| If * | iface () 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. | |
| TrainImpl * | train () 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 | |
| virtual NodeID | node_id ()=0 |
| void | initialize () |
| Callback from the simple stack to start the initialization process. | |
Protected Attributes | |
| TrainService * | service_ |
| Pointer to the traction service. | |
| TrainImpl * | train_ |
| Pointer to the train implementation object. | |
Private Attributes | |
| unsigned | isInitialized_: 1 |
| Node is initialized bit for startup transient. | |
| NodeHandle | controllerNodeId_ |
| Controller node that is assigned to run this train. 0 if none. | |
Additional Inherited Members | |
Public Attributes inherited from openlcb::TrainNodeWithConsist | |
| TypedQueue< ConsistEntry > | consistSlaves_ |
Default implementation of a train node.
Definition at line 258 of file TractionTrain.hxx.
| openlcb::DefaultTrainNode::DefaultTrainNode | ( | TrainService * | service, |
| TrainImpl * | impl | ||
| ) |
Definition at line 45 of file TractionTrain.cxx.
| openlcb::DefaultTrainNode::~DefaultTrainNode | ( | ) |
Definition at line 65 of file TractionTrain.cxx.
|
inlineoverridevirtual |
Callback from the simple stack when the node has to return to uninitialized state.
Implements openlcb::Node.
Definition at line 284 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Implements openlcb::TrainNode.
Definition at line 264 of file TractionTrain.hxx.
|
overridevirtual |
Implements openlcb::Node.
Definition at line 103 of file TractionTrain.cxx.
|
inlineoverridevirtual |
Nodes not in initialized state may not send traffic to the bus.
Implements openlcb::Node.
Definition at line 275 of file TractionTrain.hxx.
|
inlineoverridevirtual |
| id | the controller node of this train. |
Implements openlcb::TrainNode.
Definition at line 269 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Callback from the node initialization flow when the node finished initialization.
Nodes are not required to implement if they are not using NodeInitializationFlow.
Reimplemented from openlcb::Node.
Definition at line 279 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Implements openlcb::TrainNode.
Definition at line 289 of file TractionTrain.hxx.
|
private |
Controller node that is assigned to run this train. 0 if none.
Definition at line 305 of file TractionTrain.hxx.
|
private |
Node is initialized bit for startup transient.
Definition at line 302 of file TractionTrain.hxx.
|
protected |
Pointer to the traction service.
Definition at line 296 of file TractionTrain.hxx.
|
protected |
Pointer to the train implementation object.
Definition at line 298 of file TractionTrain.hxx.