|
Open Model Railroad Network (OpenMRN)
|
Intermediate class which is still abstract, but adds implementation for the consist management functions. More...
#include <TractionTrain.hxx>
Public Member Functions | |
| 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::TrainNode | |
| virtual TrainImpl * | train ()=0 |
| virtual NodeHandle | get_controller ()=0 |
| virtual void | set_controller (NodeHandle id)=0 |
Public Member Functions inherited from openlcb::Node | |
| virtual NodeID | node_id ()=0 |
| virtual If * | iface ()=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. | |
Public Attributes | |
| TypedQueue< ConsistEntry > | consistSlaves_ |
Intermediate class which is still abstract, but adds implementation for the consist management functions.
Definition at line 167 of file TractionTrain.hxx.
| openlcb::TrainNodeWithConsist::~TrainNodeWithConsist | ( | ) |
Definition at line 57 of file TractionTrain.cxx.
Adds a node ID to the consist targets.
Implements openlcb::TrainNode.
Definition at line 186 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Invoked for every incoming traction command targeted to this node.
| src | what node sent this command |
| p | command payload |
Implements openlcb::TrainNode.
Definition at line 180 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Applies a policy to function change requests coming in from the OpenLCB bus.
If the policy returns false, the change will not be applied to the TrainImpl. This is used to implement consist function behavior.
| src | source node where the request came from. |
| command_byte | is the first byte of the payload (usually 0x01 or 0x81 depending on the REQ_LISTENER bit) |
| fnum | which function to set |
| value | what value to set this function to |
| done | must be notified inline if the policy application is successful. If not notified inline, then the returned value is ignored and the call is repeated after done has been invoked by the callee. |
Implements openlcb::TrainNode.
Definition at line 173 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Returns the consist target with offset id, or NodeID(0) if there are fewer than id consist targets.
id is zero-based.
Implements openlcb::TrainNode.
Definition at line 228 of file TractionTrain.hxx.
|
inlineoverridevirtual |
Returns the number of slaves in this consist.
Implements openlcb::TrainNode.
Definition at line 244 of file TractionTrain.hxx.
Removes a node ID from the consist targets.
Implements openlcb::TrainNode.
Definition at line 211 of file TractionTrain.hxx.
| TypedQueue<ConsistEntry> openlcb::TrainNodeWithConsist::consistSlaves_ |
Definition at line 254 of file TractionTrain.hxx.