The module manager is a singleton object, so it can be instantiated only once. It contains all the active software modules which can be accessed in a centralized way.
More...
#include <ModuleManager.hpp>
The module manager is a singleton object, so it can be instantiated only once. It contains all the active software modules which can be accessed in a centralized way.
- Note
- Because modules are identified by their type, only one module per type can be inserted into the module manager. This means that every module conceptually behaves like a singleton.
Example:
class SensorsModule :
public Module {...};
class Sensors : public SensorsModule {...};
static ModuleManager & getInstance()
Definition at line 63 of file ModuleManager.hpp.
◆ ModuleManager()
Boardcore::ModuleManager::ModuleManager |
( |
| ) |
|
|
inline |
◆ ~ModuleManager()
Boardcore::ModuleManager::~ModuleManager |
( |
| ) |
|
|
inline |
◆ get()
template<class T >
T * Boardcore::ModuleManager::get |
( |
| ) |
|
|
inline |
Get the Module object if present.
- Returns
- T Software module.
-
nullptr in case of a non existing software module.
- Note
- After the get call, no further insertion is allowed.
Definition at line 137 of file ModuleManager.hpp.
◆ insert()
template<typename T >
bool Boardcore::ModuleManager::insert |
( |
T * | element | ) |
|
|
inline |
Inserts the module inside the array.
- Parameters
-
- Returns
- false in case an object of the same class has already been inserted or the maximum number of modules has been reached.
- Note
- Further insertions of modules after the first 'get()' call are not allowed. Please notice also that the module manager from this point handles completely the objects. Therefore at the destruction of the module manager, all the modules will be deleted.
Definition at line 94 of file ModuleManager.hpp.
◆ Singleton< ModuleManager >
The documentation for this class was generated from the following file: