|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef MMLMonitorDisplayFactory_H
27 #define MMLMonitorDisplayFactory_H
65 if (mapObjectCreator.find(
id) != mapObjectCreator.end()) {
69 mapObjectCreator.insert(std::pair<std::string, CreateMonitorDisplayFunctionPointer>(
id, &createTheMonitorDisplay<C>));
70 displaysByType[type].push_back(
id);
84 if (mapObjectCreator.find(
id) != mapObjectCreator.end()) {
88 mapObjectCreator.insert(std::pair<std::string, CreateMonitorDisplayFunctionPointer>(
id, &createTheMonitorDisplay<C>));
90 displaysByType[i].push_back(
id);
98 bool isRegistered(std::string
id);
107 std::string getDisplayByType(
Monitor::type type,
const unsigned int i);
124 return new C(monitor, manager);
135 #endif // MMLMonitorDisplayFactory_H
A Factory for creating MMLMonitorDiplay.
Definition: MMLMonitorDisplayFactory.h:47
MMLMonitorDisplay *(*)(Monitor *monitor, MMLComponent *manager) CreateMonitorDisplayFunctionPointer
Definition: MMLMonitorDisplayFactory.h:113
unsigned int getNumberOfDisplaysByType(Monitor::type type)
give the number of displays registered for a specified type
Definition: MMLMonitorDisplayFactory.cpp:55
static MMLMonitorDisplayFactory * getInstance()
return the unique instance of the factory
Definition: MMLMonitorDisplayFactory.cpp:60
bool isRegistered(std::string id)
Returns true if id is in the map.
Definition: MMLMonitorDisplayFactory.cpp:31
std::map< std::string, CreateMonitorDisplayFunctionPointer > mapObjectCreator
A map between MonitorDisplay name as string to functions (CreateMonitorDisplayFunctionPointer)
Definition: MMLMonitorDisplayFactory.h:116
Generic class for MML Monitor 3D/Graphical representation.
Definition: MMLMonitorDisplay.h:45
This class manage an MML monitoring document ".mml".
Definition: MMLComponent.h:48
bool registerClass(std::string id, Monitor::type type)
Register a class into the map A registered class can be created using createMonitorDisplay().
Definition: MMLMonitorDisplayFactory.h:64
type
type of the values stored (please update typeCount and doc if you update the enum) SCALAR: the monito...
Definition: Monitor.h:83
static MMLMonitorDisplayFactory * instance
unique instance of the factory
Definition: MMLMonitorDisplayFactory.h:131
static const unsigned int typeCount
number of possible types (siez of the previous enum). Please always update if the enum is updated.
Definition: Monitor.h:90
#define MMLCOMPONENT_API
Definition: MMLComponentAPI.h:54
std::string getDisplayByType(Monitor::type type, const unsigned int i)
get a display name by its type and index
Definition: MMLMonitorDisplayFactory.cpp:45
static MMLMonitorDisplay * createTheMonitorDisplay(Monitor *monitor, MMLComponent *manager)
function whose pointers are inserted into the map.
Definition: MMLMonitorDisplayFactory.h:123
MMLMonitorDisplayFactory()=default
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
std::vector< std::string > displaysByType[Monitor::typeCount]
list of displays by type
Definition: MMLMonitorDisplayFactory.h:128
MMLMonitorDisplay * createMonitorDisplay(std::string id, Monitor *monitor, MMLComponent *manager)
Creates an MMLMonitorDisplay based on its string id or return null if there is no id in the map.
Definition: MMLMonitorDisplayFactory.cpp:36
bool registerClass(std::string id)
Register a class into the map for classes wich can display every types of monitors.
Definition: MMLMonitorDisplayFactory.h:83