![]() |
MoCSI API Reference
|
Class to register and generate every module compiled into the executable. Has static auto-registry functionality, but still requires the modules to be forward-declared in the corresponding .cpp file, for they are templates and would not be instantiated by the compiler, if not declared there :/. More...
#include <ModuleFactory.h>

Public Types | |
| using | creation_method = std::shared_ptr< GenericManagingModule< T > >(*)(SimulationClassBase< T > *sim) |
| using | creation_method_submodules = std::shared_ptr< GenericSubmodule< T > >(*)(SimulationClassBase< T > *sim) |
Public Member Functions | |
| ModuleFactory ()=delete | |
Static Public Member Functions | |
| static constexpr bool | registerModule (std::string name, creation_method module) noexcept |
| Function that adds a module to the module registry map. | |
| static constexpr bool | registerModule (std::string name, creation_method_submodules module) noexcept |
| Function that adds a submodule to the submodule registry map. | |
| static std::shared_ptr< GenericManagingModule< T > > | create (const std::string &name, SimulationClassBase< T > *sim) |
| Creates a module, if a module with the corresponding name has been registered. | |
| static std::vector< std::shared_ptr< GenericManagingModule< T > > > | createAllManagingModules (SimulationClassBase< T > *sim_pointer) |
| Creates every module in the module registry. | |
| static std::vector< std::shared_ptr< GenericSubmodule< T > > > | createAllSubmodules (SimulationClassBase< T > *sim_pointer) |
| Creates every submodule in the submodule registry. | |
| static std::vector< std::shared_ptr< GenericManagingModule< T > > > | createAllSelectedManagingModules (SimulationClassBase< T > *sim_pointer, const std::vector< std::string > &list_of_mananging_modules_to_load) |
| Only creates instances of managing modules that have been specified by the user. (This allows only having ini files of actually used modules present in the ini_file folder) | |
| static std::vector< std::shared_ptr< GenericSubmodule< T > > > | createAllSelectedSubmodules (SimulationClassBase< T > *sim_pointer, const std::vector< std::shared_ptr< GenericManagingModule< T > > > &loaded_managing_modules) |
| Only creates submodules that are used within the simulation. Iteratively requests the submodule list of the currently loaded modules to create those submodules, if they haven't already been created. | |
| static std::shared_ptr< GenericSubmodule< T > > | createSubmodule (const std::string &name, SimulationClassBase< T > *sim) |
| Creates a submodule, if a submodule with the corresponding name has been registered. | |
Class to register and generate every module compiled into the executable. Has static auto-registry functionality, but still requires the modules to be forward-declared in the corresponding .cpp file, for they are templates and would not be instantiated by the compiler, if not declared there :/.
| using ModuleFactory< T >::creation_method = std::shared_ptr<GenericManagingModule<T> > (*)(SimulationClassBase<T>* sim) |
| using ModuleFactory< T >::creation_method_submodules = std::shared_ptr<GenericSubmodule<T> > (*)(SimulationClassBase<T>* sim) |
|
delete |
|
static |
Creates a module, if a module with the corresponding name has been registered.
| name | The name of the module to be created. |
|
static |
Creates every module in the module registry.
| sim_pointer | The pointer to the sim class to be automatically set in the modules |
|
static |
Only creates instances of managing modules that have been specified by the user. (This allows only having ini files of actually used modules present in the ini_file folder)
| T | Numeric type used in the simulation (e.g., float, double). |
| sim_pointer | The pointer to the simulation class. |
| list_of_mananging_modules_to_load | The user specified list of managing modules used. |
|
static |
Only creates submodules that are used within the simulation. Iteratively requests the submodule list of the currently loaded modules to create those submodules, if they haven't already been created.
| T | T Numeric type used in the simulation (e.g., float, double). |
| sim_pointer | The pointer to the simulation class. |
| loaded_managing_modules | The loaded managing modules. |
|
static |
Creates every submodule in the submodule registry.
| sim_pointer | The pointer to the sim class to be automatically set in the submodules |
|
static |
Creates a submodule, if a submodule with the corresponding name has been registered.
| name | The name of the module to be created. |
|
staticconstexprnoexcept |
Function that adds a module to the module registry map.
| name | The name of the module under which it will be added to the map |
| module | A pointer to a function that creates the module, supplied by the module themself. |
|
staticconstexprnoexcept |
Function that adds a submodule to the submodule registry map.
| name | The name of the module under which it will be added to the map |
| module | A pointer to a function that creates the module, supplied by the module themself. |