The Rokubimini Bus Manager class. More...
#include <BusManager.hpp>
Public Member Functions | |
virtual void | addRokubiminiSetupToList (const std::shared_ptr< setup::Rokubimini > &rokubiminiSetup) |
Adds a RokubiminiSetup to the internal list. More... | |
virtual bool | addRokubiminiToBus (Rokubimini *rokubimini, const std::shared_ptr< setup::Rokubimini > &rokubiminiSetup) const |
Adds a Rokubimini to Bus. More... | |
std::vector< std::shared_ptr< setup::Rokubimini > > | getRokubiminiSetups () |
Gets all the Rokubimini Setup instances from the BusManager. More... | |
virtual bool | loadSetup (std::vector< std::shared_ptr< rokubimini::Rokubimini >> &rokubiminis)=0 |
Loads the Rokubimini Setups. More... | |
virtual void | readAllBuses () |
Reads all the buses. More... | |
RokubiminiBusManager () | |
Default constructor. More... | |
virtual void | setConfigMode () |
Sets the devices controlled from the BusManager to config mode. More... | |
virtual void | setRunMode () |
Sets the devices controlled from the BusManager to run mode. More... | |
virtual void | shutdownAllBuses () |
Shuts down all the buses. More... | |
virtual bool | startupCommunication () |
Starts the communication through the bus. More... | |
virtual void | writeToAllBuses () |
Writes to all the buses. More... | |
virtual | ~RokubiminiBusManager ()=default |
Protected Attributes | |
std::vector< std::shared_ptr< setup::Rokubimini > > | attachedRokubiminiSetups_ |
The Rokubimini Bus Manager class.
Base class which provides an extendable API. It's useful for creating a bus manager with an existing communication protocol.
Definition at line 23 of file BusManager.hpp.
|
inline |
Default constructor.
This method constructs a RokubiminiBusManager and clears the contents of the protected vector attachedRokubiminiSetups_.
Definition at line 36 of file BusManager.hpp.
|
virtualdefault |
|
virtual |
Adds a RokubiminiSetup to the internal list.
This setter method is used for adding a Rokubimini Setup (implementation-specific) to the internal list.
rokubiminiSetup | The RokubiminiSetup instance. |
Definition at line 13 of file BusManager.cpp.
|
virtual |
Adds a Rokubimini to Bus.
This method is used for adding a Rokubimini (implementation-specific) to the Bus (implementation-specific). This method is bound to each implementation and the reason that it's here, is because of runtime polymorphism through inheritance. It should be pointed that the methods in the children of this class, add the implementation pointer to the Rokubimini implementation (e.g. RokubiminiSerialImplPtr to the RokubiminiSerial instance).
rokubimini | The Rokubimini instance. |
rokubiminiSetup | The corresponding Rokubimini Setup instance. |
Definition at line 8 of file BusManager.cpp.
|
inline |
Gets all the Rokubimini Setup instances from the BusManager.
This getter method returns all the Rokubimini Setups attached to the BusManager.
Definition at line 175 of file BusManager.hpp.
|
pure virtual |
Loads the Rokubimini Setups.
This method is used for loading the Rokubimini Setups assigned to the Bus Manager and then attaching them to the existing bus. This method is implementation-specific, therefore it's pure virtual in the RokubiminiBusManager class. It's given as input the vector with pointers to every rokubimini, from which the implementation should grub the ones which are relevenant to it and attach them to the bus. This is done by calling addRokubiminiToBus.
rokubiminis | The vector holding all the pointers to the existing Rokubiminis. |
|
inlinevirtual |
Reads all the buses.
This method reads all the buses which have been created by the BusManager.
Definition at line 139 of file BusManager.hpp.
|
inlinevirtual |
Sets the devices controlled from the BusManager to config mode.
This method allows the BusManager to set the devices to configuration mode before the startup() method is called for every Rokubimini instance.
Definition at line 151 of file BusManager.hpp.
|
inlinevirtual |
Sets the devices controlled from the BusManager to run mode.
This method allows the BusManager to set the devices to run mode after the startup() method is called for every Rokubimini instance.
Definition at line 163 of file BusManager.hpp.
|
inlinevirtual |
Shuts down all the buses.
This method shuts down all the buses which have been created by the BusManager.
Definition at line 116 of file BusManager.hpp.
|
inlinevirtual |
Starts the communication through the bus.
This method starts the communication with each attached Rokubimini through the bus.
Definition at line 101 of file BusManager.hpp.
|
inlinevirtual |
Writes to all the buses.
This method writes to all the buses which have been created by the BusManager.
Definition at line 128 of file BusManager.hpp.
|
protected |
Definition at line 188 of file BusManager.hpp.