MoCSI API Reference
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
StaticModuleContainer< T > Class Template Reference

Class that creates all modules and allows access to the module pointers in static contexts. This enables inter-module access to public functions and allows for complex inter-module behaviours and efficient data sharing. More...

#include <StaticModuleContainer.h>

Collaboration diagram for StaticModuleContainer< T >:
Collaboration graph

Public Member Functions

 StaticModuleContainer (SimulationClassBase< T > *sim_ptr)
 Construct a new Static Module Container object. Also creates all modules (all selected modules as soon as the branch is merged).
 

Static Public Member Functions

static bool isInitialized ()
 Getter function for the m_modules_created boolean. Is set to true, if this module has been created (once) and thus the module lists actually filled.
 
static std::vector< std::shared_ptr< GenericManagingModule< T > > > & getAllSelectedManagingModules ()
 Get all selected managing modules (static).
 
static std::vector< std::shared_ptr< GenericSubmodule< T > > > & getAllSelectedSubmodules ()
 Get all selected submodules (static).
 
static std::shared_ptr< GenericManagingModule< T > > getSelectedManagingModule (const std::string &key)
 Get a specified managing module.
 
static std::shared_ptr< GenericSubmodule< T > > getSelectedSubmodule (const std::string &key)
 Get the specified submodule.
 

Detailed Description

template<typename T>
class StaticModuleContainer< T >

Class that creates all modules and allows access to the module pointers in static contexts. This enables inter-module access to public functions and allows for complex inter-module behaviours and efficient data sharing.

Template Parameters
TNumeric type used in the simulation (e.g., float, double)

Constructor & Destructor Documentation

◆ StaticModuleContainer()

Construct a new Static Module Container object. Also creates all modules (all selected modules as soon as the branch is merged).

Parameters
sim_ptrThe pointer to the simulation class.

Member Function Documentation

◆ getAllSelectedManagingModules()

template<typename T >
static std::vector< std::shared_ptr< GenericManagingModule< T > > > & StaticModuleContainer< T >::getAllSelectedManagingModules ( )
inlinestatic

Get all selected managing modules (static).

Returns
std::vector<std::shared_ptr<GenericManagingModule<T>>>& All loaded managing modules vector.

◆ getAllSelectedSubmodules()

template<typename T >
static std::vector< std::shared_ptr< GenericSubmodule< T > > > & StaticModuleContainer< T >::getAllSelectedSubmodules ( )
inlinestatic

Get all selected submodules (static).

Returns
std::vector<std::shared_ptr<GenericSubmodule<T>>>& All loaded submodules vector.

◆ getSelectedManagingModule()

template<typename T >
static std::shared_ptr< GenericManagingModule< T > > StaticModuleContainer< T >::getSelectedManagingModule ( const std::string &  key)
inlinestatic

Get a specified managing module.

Parameters
keyThe name of the managing module to get.
Returns
std::shared_ptr<GenericManagingModule<T>> The selected managing module.

◆ getSelectedSubmodule()

template<typename T >
static std::shared_ptr< GenericSubmodule< T > > StaticModuleContainer< T >::getSelectedSubmodule ( const std::string &  key)
inlinestatic

Get the specified submodule.

Parameters
keyThe name of the submanaging to get.
Returns
std::shared_ptr<GenericSubmodule<T>> The selected submodule.

◆ isInitialized()

template<typename T >
static bool StaticModuleContainer< T >::isInitialized ( )
inlinestatic

Getter function for the m_modules_created boolean. Is set to true, if this module has been created (once) and thus the module lists actually filled.

Returns
true
false

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