OpenMS
SingletonRegistry Class Reference

Holds pointers to unique instance of a singleton factory. More...

#include <OpenMS/CONCEPT/SingletonRegistry.h>

Collaboration diagram for SingletonRegistry:
[legend]

Static Public Member Functions

static FactoryBasegetFactory (const String &name)
 return DefaultParamHandler according to unique identifier name More...
 
static void registerFactory (const String &name, FactoryBase *instance)
 register new concrete Factory More...
 
static bool isRegistered (String name)
 Returns if a factory is registered. More...
 

Private Types

typedef std::map< String, FactoryBase * > Map
 Function signature of creator function. More...
 
typedef Map::const_iterator MapIterator
 

Private Member Functions

virtual ~SingletonRegistry ()
 destructor More...
 
 SingletonRegistry ()
 C'Tor. More...
 

Static Private Member Functions

static SingletonRegistryinstance_ ()
 singleton access to SingletonRegistry More...
 

Private Attributes

Map inventory_
 

Static Private Attributes

static SingletonRegistrysingletonRegistryInstance_
 

Friends

class singletonsNeedNoFriends
 

Detailed Description

Holds pointers to unique instance of a singleton factory.

Note
: NEVER(!) include this file anywhere (except for the SingletonRegistry.cpp)! :D

Member Typedef Documentation

◆ Map

typedef std::map<String, FactoryBase *> Map
private

Function signature of creator function.

◆ MapIterator

typedef Map::const_iterator MapIterator
private

Constructor & Destructor Documentation

◆ ~SingletonRegistry()

virtual ~SingletonRegistry ( )
inlineprivatevirtual

destructor

◆ SingletonRegistry()

SingletonRegistry ( )
inlineprivate

C'Tor.

Member Function Documentation

◆ getFactory()

static FactoryBase* getFactory ( const String name)
inlinestatic

return DefaultParamHandler according to unique identifier name

Referenced by Factory< FactoryProduct >::instance_().

◆ instance_()

static SingletonRegistry* instance_ ( )
inlinestaticprivate

singleton access to SingletonRegistry

◆ isRegistered()

static bool isRegistered ( String  name)
inlinestatic

Returns if a factory is registered.

Referenced by Factory< FactoryProduct >::instance_().

◆ registerFactory()

static void registerFactory ( const String name,
FactoryBase instance 
)
inlinestatic

register new concrete Factory

Parameters
nameunique name for Factory of certain type
instancepointer to this Factory

Referenced by Factory< FactoryProduct >::instance_().

Friends And Related Function Documentation

◆ singletonsNeedNoFriends

friend class singletonsNeedNoFriends
friend

Member Data Documentation

◆ inventory_

Map inventory_
private

◆ singletonRegistryInstance_

SingletonRegistry* singletonRegistryInstance_
staticprivate