|
Open Model Railroad Network (OpenMRN)
|
Collection of control flows necessary for implementing the Traction Protocol. More...
#include <TractionTrain.hxx>
Classes | |
| struct | Impl |
| Implementation structure for TrainService. More... | |
Public Member Functions | |
| TrainService (If *iface, NodeRegistry *train_node_registry=new DefaultNodeRegistry) | |
| Constructor. | |
| If * | iface () |
| void | register_train (TrainNode *node) |
| Registers a new train with the train service. | |
| void | unregister_train (TrainNode *node) |
| Removes a train node from the local interface. | |
| bool | is_known_train_node (Node *node) |
| Checks if the a given node is a train node operated by this Traction Service. | |
Public Member Functions inherited from Service | |
| Service (ExecutorBase *e) | |
| Constructor. | |
| ~Service () | |
| Destructor. | |
| ExecutorBase * | executor () |
Private Attributes | |
| Impl * | impl_ |
| Implementation flows. | |
| If * | iface_ |
| OpenLCB interface. | |
| std::unique_ptr< NodeRegistry > | nodes_ |
| List of train nodes managed by this Service. | |
Additional Inherited Members | |
Private Member Functions inherited from Atomic | |
| void | lock () |
| void | unlock () |
Collection of control flows necessary for implementing the Traction Protocol.
usage: instantiate for the given interface. Pass the pointer to the train nodes upon their construction.
Definition at line 357 of file TractionTrain.hxx.
| openlcb::TrainService::TrainService | ( | If * | iface, |
| NodeRegistry * | train_node_registry = new DefaultNodeRegistry |
||
| ) |
Constructor.
| iface | the OpenLCB interface to which the train nodes are bound. |
| train_node_registry | implementation of the NodeRegistry. Ownership is transferred. |
Definition at line 664 of file TractionTrain.cxx.
| openlcb::TrainService::~TrainService | ( | ) |
Definition at line 672 of file TractionTrain.cxx.
|
inline |
Definition at line 368 of file TractionTrain.hxx.
Checks if the a given node is a train node operated by this Traction Service.
| node | a virtual node |
Definition at line 385 of file TractionTrain.hxx.
| void openlcb::TrainService::register_train | ( | TrainNode * | node | ) |
Registers a new train with the train service.
Will initiate a node initialization flow for the train.
Definition at line 677 of file TractionTrain.cxx.
| void openlcb::TrainService::unregister_train | ( | TrainNode * | node | ) |
Removes a train node from the local interface.
| node | train to remove from registry. |
Definition at line 687 of file TractionTrain.cxx.
|
private |
OpenLCB interface.
Definition at line 395 of file TractionTrain.hxx.
|
private |
Implementation flows.
Definition at line 393 of file TractionTrain.hxx.
|
private |
List of train nodes managed by this Service.
Definition at line 397 of file TractionTrain.hxx.