PARTONS
|
PARtonic Tomography Of Nucleon Software
|
Provides a clone (returned as a BaseObject pointer) of an object identified by its class name and previously stored in the BaseObjectRegistry. More...
Public Member Functions | |
virtual | ~BaseObjectFactory () |
Default destructor. More... | |
BaseObject * | newBaseObject (unsigned int classId) |
Provides a clone of the desired object class stored in the registry identified by its integer identifier. More... | |
BaseObject * | newBaseObject (const std::string &className) |
Provides a clone of the desired object class stored in the registry identified by its string class name. More... | |
void | removeFromStore (unsigned int baseObjectUniqueId) |
Remove an object from the factory. More... | |
Private Member Functions | |
BaseObjectFactory (BaseObjectRegistry *pBaseObjectRegistry) | |
Private default constructor to ensure the creation of a single instance of the class, managed by Parton's class. More... | |
void | store (BaseObject *pBaseObject) |
Store cloned object pointer to its instantiated object map. More... | |
Private Attributes | |
sf::Mutex | m_mutex |
Mutex to secure concurrent access to the map of instanciated obejcts. More... | |
BaseObjectRegistry * | m_pBaseObjectRegistry |
Pointer to ask BaseObjectRegistry pointer associated to a specific object class. More... | |
std::map< unsigned int, BaseObject * > | m_pInstantiatedObject |
Store BaseObject pointer created by the factory; used at the end of the program to delete orphan pointer. More... | |
Friends | |
class | Partons |
Provides a clone (returned as a BaseObject pointer) of an object identified by its class name and previously stored in the BaseObjectRegistry.
Furthermore, a pointer to each clone is registered in order to destroy it later on if it becomes orphan.
This class is only instantiable by the class Partons to avoid any error at the initialization of the program.
|
virtual |
Default destructor.
|
private |
Private default constructor to ensure the creation of a single instance of the class, managed by Parton's class.
pBaseObjectRegistry |
BaseObject * PARTONS::BaseObjectFactory::newBaseObject | ( | const std::string & | className | ) |
Provides a clone of the desired object class stored in the registry identified by its string class name.
classId |
BaseObject * PARTONS::BaseObjectFactory::newBaseObject | ( | unsigned int | classId | ) |
Provides a clone of the desired object class stored in the registry identified by its integer identifier.
classId |
void PARTONS::BaseObjectFactory::removeFromStore | ( | unsigned int | baseObjectUniqueId | ) |
Remove an object from the factory.
baseObjectUniqueId | Unique id identifying each object. |
|
private |
Store cloned object pointer to its instantiated object map.
pBaseObject |
|
friend |
|
private |
Mutex to secure concurrent access to the map of instanciated obejcts.
|
private |
Pointer to ask BaseObjectRegistry pointer associated to a specific object class.
|
private |
Store BaseObject pointer created by the factory; used at the end of the program to delete orphan pointer.