1#ifndef MODULE_FACTORY_H
2#define MODULE_FACTORY_H
8#include <unordered_map>
36 static std::shared_ptr<GenericManagingModule<T>>
create(
const std::string&
name,
42 static std::vector<std::shared_ptr<GenericManagingModule<T>>>
53 static std::unordered_map<std::string, creation_method_submodules> m_registry_submodules;
54 static std::unordered_map<std::string, creation_method> m_registry;
59std::unordered_map<std::string,
64std::unordered_map<std::string,
83 std::cout <<
"Registering: " <<
name <<
"\n";
103 throw std::runtime_error(
"ModuleFactory: No module registered with name: " +
name);
122 std::cout <<
"Registering submodule: " <<
name <<
"\n";
144 throw std::runtime_error(
"ModuleFactory: No module registered with name: " +
name);
194std::vector<std::shared_ptr<GenericManagingModule<T>>>
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:35
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:92
Class to register and generate every module compiled into the executable. Has static auto-registry fu...
Definition ModuleFactory.h:22
std::shared_ptr< GenericManagingModule< T > >(*)(SimulationClassBase< T > *sim) creation_method
Definition ModuleFactory.h:25
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 ha...
Definition ModuleFactory.h:195
static constexpr bool registerModule(std::string name, creation_method module) noexcept
Function that adds a module to the module registry map.
Definition ModuleFactory.h:75
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 ...
Definition ModuleFactory.h:224
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.
Definition ModuleFactory.h:134
static std::vector< std::shared_ptr< GenericSubmodule< T > > > createAllSubmodules(SimulationClassBase< T > *sim_pointer)
Creates every submodule in the submodule registry.
Definition ModuleFactory.h:172
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.
Definition ModuleFactory.h:95
std::shared_ptr< GenericSubmodule< T > >(*)(SimulationClassBase< T > *sim) creation_method_submodules
Definition ModuleFactory.h:27
static std::vector< std::shared_ptr< GenericManagingModule< T > > > createAllManagingModules(SimulationClassBase< T > *sim_pointer)
Creates every module in the module registry.
Definition ModuleFactory.h:153