Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MMLMonitorDisplayFactory Class Reference

A Factory for creating MMLMonitorDiplay. More...

#include <MMLMonitorDisplayFactory.h>

Public Member Functions

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. More...
 
std::string getDisplayByType (Monitor::type type, const unsigned int i)
 get a display name by its type and index More...
 
unsigned int getNumberOfDisplaysByType (Monitor::type type)
 give the number of displays registered for a specified type More...
 
bool isRegistered (std::string id)
 Returns true if id is in the map. More...
 
template<typename C >
bool registerClass (std::string id, Monitor::type type)
 Register a class into the map A registered class can be created using createMonitorDisplay(). More...
 
template<typename C >
bool registerClass (std::string id)
 Register a class into the map for classes wich can display every types of monitors. More...
 

Static Public Member Functions

static MMLMonitorDisplayFactory * getInstance ()
 return the unique instance of the factory More...
 

Private Types

typedef MMLMonitorDisplay *(* CreateMonitorDisplayFunctionPointer )(Monitor *monitor, MMLComponent *manager)
 

Private Member Functions

 MMLMonitorDisplayFactory ()
 

Static Private Member Functions

template<typename C >
static MMLMonitorDisplay * createTheMonitorDisplay (Monitor *monitor, MMLComponent *manager)
 function whose pointers are inserted into the map. More...
 

Private Attributes

std::vector< std::string > displaysByType [Monitor::typeCount]
 list of displays by type More...
 
std::map< std::string,
CreateMonitorDisplayFunctionPointer > 
mapObjectCreator
 A map between MonitorDisplay name as string to functions (CreateMonitorDisplayFunctionPointer) More...
 

Static Private Attributes

static MMLMonitorDisplayFactory * instance
 unique instance of the factory More...
 

Detailed Description

A Factory for creating MMLMonitorDiplay.

Member Typedef Documentation

typedef MMLMonitorDisplay*(* MMLMonitorDisplayFactory::CreateMonitorDisplayFunctionPointer)(Monitor *monitor, MMLComponent *manager)
private

Constructor & Destructor Documentation

MMLMonitorDisplayFactory::MMLMonitorDisplayFactory ( )
private

Member Function Documentation

MMLMonitorDisplay* MMLMonitorDisplayFactory::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.

template<typename C >
static MMLMonitorDisplay* MMLMonitorDisplayFactory::createTheMonitorDisplay ( Monitor *  monitor,
MMLComponent *  manager 
)
inlinestaticprivate

function whose pointers are inserted into the map.

C is the type of MMLMonitorDisplay

Returns
an MonitorDisplay which type is C
std::string MMLMonitorDisplayFactory::getDisplayByType ( Monitor::type  type,
const unsigned int  i 
)

get a display name by its type and index

static MMLMonitorDisplayFactory* MMLMonitorDisplayFactory::getInstance ( )
static

return the unique instance of the factory

unsigned int MMLMonitorDisplayFactory::getNumberOfDisplaysByType ( Monitor::type  type)

give the number of displays registered for a specified type

bool MMLMonitorDisplayFactory::isRegistered ( std::string  id)

Returns true if id is in the map.

template<typename C >
bool MMLMonitorDisplayFactory::registerClass ( std::string  id,
Monitor::type  type 
)
inline

Register a class into the map A registered class can be created using createMonitorDisplay().

C is a subclass of MMLMonitorDisplay.

Parameters
idunique id to associate with the Class C
typethe type of monitor the class can display

References displaysByType, and mapObjectCreator.

template<typename C >
bool MMLMonitorDisplayFactory::registerClass ( std::string  id)
inline

Register a class into the map for classes wich can display every types of monitors.

C is a subclass of MMLMonitorDisplay.

Parameters
idunique id to associate with the Class C

References displaysByType, mapObjectCreator, and Monitor::typeCount.

Member Data Documentation

std::vector<std::string> MMLMonitorDisplayFactory::displaysByType[Monitor::typeCount]
private

list of displays by type

Referenced by registerClass().

MMLMonitorDisplayFactory* MMLMonitorDisplayFactory::instance
staticprivate

unique instance of the factory

std::map<std::string, CreateMonitorDisplayFunctionPointer> MMLMonitorDisplayFactory::mapObjectCreator
private

A map between MonitorDisplay name as string to functions (CreateMonitorDisplayFunctionPointer)

Referenced by registerClass().


The documentation for this class was generated from the following file: