Health-GPS
1.2.2.0
Global Health Policy Simulation model (Health-GPS)
|
Defines the SimulationModule factory data type. More...
#include <modulefactory.h>
Public Types | |
using | ModuleType = std::shared_ptr< SimulationModule > |
Base module type. More... | |
using | ConcreteBuilder = ModuleType(*)(Repository &, const ModelInput &) |
Concrete module builder function signature. More... | |
Public Member Functions | |
SimulationModuleFactory ()=delete | |
SimulationModuleFactory (Repository &data_repository) | |
Initialises a new instance of the SimulationModuleFactory class. More... | |
std::size_t | size () const noexcept |
Gets the number of registered module instance. More... | |
bool | contains (const SimulationModuleType type) const noexcept |
Determine whether the factory contains an instance of a module type. More... | |
void | register_builder (const SimulationModuleType type, const ConcreteBuilder builder) |
Registers a simulation module type builder function. More... | |
ModuleType | create (const SimulationModuleType type, const ModelInput &config) |
Create a polymorphic SimulationModule instance. More... | |
Defines the SimulationModule factory data type.
The module factory is used to assemble the concrete modules implementation to compose the Health-GPS microsimulation instance. The simulation engine will request an instance of each of the SimulationModuleType enumeration module at construction.
The concrete builder function receives an instance of the back-end data storage and the user simulation inputs to create the respective module type instance for use by the microsimulation algorithm.
using hgps::SimulationModuleFactory::ConcreteBuilder = ModuleType (*)(Repository &, const ModelInput &) |
Concrete module builder function signature.
using hgps::SimulationModuleFactory::ModuleType = std::shared_ptr<SimulationModule> |
Base module type.
|
delete |
hgps::SimulationModuleFactory::SimulationModuleFactory | ( | Repository & | data_repository | ) |
Initialises a new instance of the SimulationModuleFactory class.
data_repository | The back-end data repository instance to use |
|
noexcept |
Determine whether the factory contains an instance of a module type.
type | The simulation module type |
SimulationModuleFactory::ModuleType hgps::SimulationModuleFactory::create | ( | const SimulationModuleType | type, |
const ModelInput & | config | ||
) |
Create a polymorphic SimulationModule instance.
type | The simulation module type |
config | The simulation model inputs definition |
void hgps::SimulationModuleFactory::register_builder | ( | const SimulationModuleType | type, |
const ConcreteBuilder | builder | ||
) |
Registers a simulation module type builder function.
type | The simulation module type |
builder | The module type instance builder function |
|
noexcept |
Gets the number of registered module instance.