Public Member Functions | Protected Attributes | List of all members
rokubimini::RokubiminiBusManager Class Referenceabstract

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

rokubimini::RokubiminiBusManager::RokubiminiBusManager ( )
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.

virtual rokubimini::RokubiminiBusManager::~RokubiminiBusManager ( )
virtualdefault

Member Function Documentation

void rokubimini::RokubiminiBusManager::addRokubiminiSetupToList ( const std::shared_ptr< setup::Rokubimini > &  rokubiminiSetup)
virtual

Adds a RokubiminiSetup to the internal list.

This setter method is used for adding a Rokubimini Setup (implementation-specific) to the internal list.

Parameters
rokubiminiSetupThe RokubiminiSetup instance.

Definition at line 13 of file BusManager.cpp.

bool rokubimini::RokubiminiBusManager::addRokubiminiToBus ( Rokubimini rokubimini,
const std::shared_ptr< setup::Rokubimini > &  rokubiminiSetup 
) const
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).

Parameters
rokubiminiThe Rokubimini instance.
rokubiminiSetupThe corresponding Rokubimini Setup instance.

Definition at line 8 of file BusManager.cpp.

void rokubimini::RokubiminiBusManager::getRokubiminiSetups ( )
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.

bool rokubimini::RokubiminiBusManager::loadSetup ( std::vector< std::shared_ptr< rokubimini::Rokubimini >> &  rokubiminis)
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.

Parameters
rokubiminisThe vector holding all the pointers to the existing Rokubiminis.
void rokubimini::RokubiminiBusManager::readAllBuses ( )
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.

void rokubimini::RokubiminiBusManager::setConfigMode ( )
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.

void rokubimini::RokubiminiBusManager::setRunMode ( )
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.

void rokubimini::RokubiminiBusManager::shutdownAllBuses ( )
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.

bool rokubimini::RokubiminiBusManager::startupCommunication ( )
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.

void rokubimini::RokubiminiBusManager::writeToAllBuses ( )
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.

Member Data Documentation

std::vector<std::shared_ptr<setup::Rokubimini> > rokubimini::RokubiminiBusManager::attachedRokubiminiSetups_
protected

Definition at line 188 of file BusManager.hpp.


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


rokubimini_bus_manager
Author(s):
autogenerated on Wed Mar 3 2021 03:09:14