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())
Invalid value exception.
Definition: Exception.h:329
Base class for Factory<T>
Definition: FactoryBase.h:49
Holds pointers to unique instance of a singleton factory.
Definition: SingletonRegistry.h:55
Map inventory_
Definition: SingletonRegistry.h:118
static SingletonRegistry * singletonRegistryInstance_
Definition: SingletonRegistry.h:119
std::map< String, FactoryBase * > Map
Function signature of creator function.
Definition: SingletonRegistry.h:60
static SingletonRegistry * instance_()
singleton access to SingletonRegistry
Definition: SingletonRegistry.h:70
static bool isRegistered(String name)
Returns if a factory is registered.
Definition: SingletonRegistry.h:107
Map::const_iterator MapIterator
Definition: SingletonRegistry.h:61
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 void registerFactory(const String &name, FactoryBase *instance)
register new concrete Factory
Definition: SingletonRegistry.h:101
virtual ~SingletonRegistry()
destructor
Definition: SingletonRegistry.h:64
A more convenient string class.
Definition: String.h:61
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47