![]() |
Computer Assited Medical Intervention Tool Kit
version 3.3
|
A factory to create Simulator. More...
#include <SimulatorFactory.h>
Public Member Functions | |
Simulator * | createSimulator (std::string id, MonitoringManager *monitoringManager) |
Creates a Simulator based on its string id or return null if there is no id in the map. More... | |
Simulator * | createSimulator (std::string id, MonitoringManager *monitoringManager, const char *file) |
Creates a Simulator using a specific simulator file based on its string id or return null if there is no id in the map. More... | |
std::string | getInteractiveSimulator (const unsigned int index) |
get a interactive simulator name by its index More... | |
std::string | getNonInteractiveSimulator (const unsigned int index) |
get a non interactive simulator name by its index More... | |
int | getNumberOfInteractiveSimulators () |
give the number of interactive simulators registered More... | |
int | getNumberOfNonInteractiveSimulators () |
give the number of interactive simulators registered More... | |
bool | isInteractive (std::string id) |
return true if the registered simulator id is interactive More... | |
bool | isRegistered (std::string id) |
Returns true if id is in the map. More... | |
template<typename C > | |
bool | registerClass (std::string id, bool isInteractive) |
Register a class into the map A registered class can be created using createMonitorDisplay() More... | |
Static Public Member Functions | |
static SimulatorFactory * | getInstance () |
return the unique instance of the factory More... | |
Private Types | |
typedef Simulator *(* | CreateSimulatorFunctionPointer )(MonitoringManager *monitoringManager) |
typedef Simulator *(* | CreateSimulatorFunctionPointer2 )(MonitoringManager *monitoringManager, const char *file) |
Private Member Functions | |
SimulatorFactory () | |
Static Private Member Functions | |
template<typename C > | |
static Simulator * | createTheSimulator (MonitoringManager *monitoringManager) |
map the simulator name with the 1 parameter constructor. More... | |
template<typename C > | |
static Simulator * | createTheSimulator2 (MonitoringManager *monitoringManager, const char *file) |
map the simulator name with the 2 parameters constructor (using the given specific simulator file) More... | |
Private Attributes | |
std::vector< std::string > | interactiveSimulators |
list of interactive simulators More... | |
std::map< std::string, bool > | mapInteractive |
map between Simulator name as string to booleen, true if interactive More... | |
std::map< std::string, CreateSimulatorFunctionPointer > | mapObjectCreator |
A map between Simulator name as string to functions. More... | |
std::map< std::string, CreateSimulatorFunctionPointer2 > | mapObjectCreator2 |
A map between Simulator name as string to functions (for the 2nd constructor that uses a simulator file) More... | |
std::vector< std::string > | nonInteractiveSimulators |
list of non interactive simulators More... | |
Static Private Attributes | |
static SimulatorFactory * | instance |
unique instance of the factory More... | |
A factory to create Simulator.
|
private |
|
private |
|
private |
Simulator* SimulatorFactory::createSimulator | ( | std::string | id, |
MonitoringManager * | monitoringManager | ||
) |
Creates a Simulator based on its string id or return null if there is no id in the map.
Simulator* SimulatorFactory::createSimulator | ( | std::string | id, |
MonitoringManager * | monitoringManager, | ||
const char * | file | ||
) |
Creates a Simulator using a specific simulator file based on its string id or return null if there is no id in the map.
|
inlinestaticprivate |
map the simulator name with the 1 parameter constructor.
function whose pointers are inserted into the map
C | type of Simulator |
|
inlinestaticprivate |
map the simulator name with the 2 parameters constructor (using the given specific simulator file)
function whose pointers are inserted into the map
C | type of Simulator |
file | specific simulator file |
|
static |
return the unique instance of the factory
std::string SimulatorFactory::getInteractiveSimulator | ( | const unsigned int | index | ) |
get a interactive simulator name by its index
std::string SimulatorFactory::getNonInteractiveSimulator | ( | const unsigned int | index | ) |
get a non interactive simulator name by its index
int SimulatorFactory::getNumberOfInteractiveSimulators | ( | ) |
give the number of interactive simulators registered
int SimulatorFactory::getNumberOfNonInteractiveSimulators | ( | ) |
give the number of interactive simulators registered
bool SimulatorFactory::isInteractive | ( | std::string | id | ) |
return true if the registered simulator id is interactive
bool SimulatorFactory::isRegistered | ( | std::string | id | ) |
Returns true if id is in the map.
|
inline |
Register a class into the map A registered class can be created using createMonitorDisplay()
C | a subclass of Simulator |
id | unique id to associate with the Class C |
|
staticprivate |
unique instance of the factory
|
private |
list of interactive simulators
|
private |
map between Simulator name as string to booleen, true if interactive
|
private |
A map between Simulator name as string to functions.
|
private |
A map between Simulator name as string to functions (for the 2nd constructor that uses a simulator file)
|
private |
list of non interactive simulators