PARTONS/NumA++  
Numerical Analysis C++ routines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
NumA::IntegratorRegistry Class Reference

Public Member Functions

virtual ~IntegratorRegistry ()
 Default destructor. More...
 
unsigned int registerIntegrator (Integrator *pIntegrator)
 
Integratorget (unsigned int classId) const
 Try to find stored object identified by its unique class identifier. More...
 
Integratorget (const std::string &className) const
 Try to find stored object identified by its class name. More...
 

Static Public Member Functions

static IntegratorRegistrygetInstance ()
 Static function to be able to retrieve a unique instance pointer of this class anywhere in the code. More...
 

Private Member Functions

 IntegratorRegistry ()
 Private default constructor for a unique instance. More...
 

Private Attributes

sf::Mutex m_mutex
 Because NumA++ can be use in a multi-threading program we must ensure that only one object manipulates the registry at the same time to avoid memory access violation. More...
 
std::map< unsigned int, Integrator * > m_baseObjectList
 list of registered objects identified by their unique integer identifier More...
 
std::map< std::string, Integrator * > m_translateList
 list of registered objects identified by their class name. More...
 

Static Private Attributes

static IntegratorRegistrym_pInstance = 0
 Private pointer of this class for a unique instance. More...
 

Constructor & Destructor Documentation

◆ ~IntegratorRegistry()

NumA::IntegratorRegistry::~IntegratorRegistry ( )
virtual

Default destructor.

◆ IntegratorRegistry()

NumA::IntegratorRegistry::IntegratorRegistry ( )
private

Private default constructor for a unique instance.

Member Function Documentation

◆ get() [1/2]

Integrator * NumA::IntegratorRegistry::get ( const std::string &  className) const

Try to find stored object identified by its class name.

Parameters
className
Returns
reference to object in memory or throw an exception

◆ get() [2/2]

Integrator * NumA::IntegratorRegistry::get ( unsigned int  classId) const

Try to find stored object identified by its unique class identifier.

Parameters
classId
Returns
reference to object in memory or throw an exception

◆ getInstance()

IntegratorRegistry * NumA::IntegratorRegistry::getInstance ( )
static

Static function to be able to retrieve a unique instance pointer of this class anywhere in the code.

Returns
a unique instance of this class

◆ registerIntegrator()

unsigned int NumA::IntegratorRegistry::registerIntegrator ( Integrator pIntegrator)

Member Data Documentation

◆ m_baseObjectList

std::map<unsigned int, Integrator*> NumA::IntegratorRegistry::m_baseObjectList
private

list of registered objects identified by their unique integer identifier

◆ m_mutex

sf::Mutex NumA::IntegratorRegistry::m_mutex
mutableprivate

Because NumA++ can be use in a multi-threading program we must ensure that only one object manipulates the registry at the same time to avoid memory access violation.

It's performed by a mechanism called mutex or semaphore.

◆ m_pInstance

IntegratorRegistry * NumA::IntegratorRegistry::m_pInstance = 0
staticprivate

Private pointer of this class for a unique instance.

◆ m_translateList

std::map<std::string, Integrator*> NumA::IntegratorRegistry::m_translateList
private

list of registered objects identified by their class name.


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