|
OpenMS
2.6.0
|
Go to the documentation of this file.
56 friend class singletonsNeedNoFriends;
60 typedef std::map<String, FactoryBase *>
Map;
72 if (!singletonRegistryInstance_)
76 return singletonRegistryInstance_;
84 MapIterator it = instance_()->inventory_.find(name);
85 if (it != instance_()->inventory_.end())
91 throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"This Factory is not registered with SingletonRegistry!", name.c_str());
103 instance_()->inventory_[name] = instance;
109 if (instance_()->inventory_.find(name) != instance_()->inventory_.end())
Map inventory_
Definition: SingletonRegistry.h:118
static SingletonRegistry * instance_()
singleton access to SingletonRegistry
Definition: SingletonRegistry.h:70
Invalid value exception.
Definition: Exception.h:335
A more convenient string class.
Definition: String.h:59
Map::const_iterator MapIterator
Definition: SingletonRegistry.h:61
static void registerFactory(const String &name, FactoryBase *instance)
register new concrete Factory
Definition: SingletonRegistry.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Holds pointers to unique instance of a singleton factory.
Definition: SingletonRegistry.h:54
virtual ~SingletonRegistry()
destructor
Definition: SingletonRegistry.h:64
static bool isRegistered(String name)
Returns if a factory is registered.
Definition: SingletonRegistry.h:107
SingletonRegistry()
C'Tor.
Definition: SingletonRegistry.h:67
static FactoryBase * getFactory(const String &name)
return DefaultParamHandler according to unique identifier name
Definition: SingletonRegistry.h:82
static SingletonRegistry * singletonRegistryInstance_
Definition: SingletonRegistry.h:119
Base class for Factory<T>
Definition: FactoryBase.h:48
std::map< String, FactoryBase * > Map
Function signature of creator function.
Definition: SingletonRegistry.h:60