30 friend class singletonsNeedNoFriends;
34 typedef std::map<String, FactoryBase *>
Map;
46 if (!singletonRegistryInstance_)
50 return singletonRegistryInstance_;
58 MapIterator it = instance_()->inventory_.find(name);
59 if (it != instance_()->inventory_.end())
65 throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"This Factory is not registered with SingletonRegistry!", name.c_str());
77 instance_()->inventory_[name] = instance;
83 if (instance_()->inventory_.find(name) != instance_()->inventory_.end())
Invalid value exception.
Definition: Exception.h:303
Base class for Factory<T>
Definition: FactoryBase.h:23
Holds pointers to unique instance of a singleton factory.
Definition: SingletonRegistry.h:29
Map inventory_
Definition: SingletonRegistry.h:92
static SingletonRegistry * singletonRegistryInstance_
Definition: SingletonRegistry.h:93
std::map< String, FactoryBase * > Map
Function signature of creator function.
Definition: SingletonRegistry.h:34
static SingletonRegistry * instance_()
singleton access to SingletonRegistry
Definition: SingletonRegistry.h:44
static bool isRegistered(String name)
Returns if a factory is registered.
Definition: SingletonRegistry.h:81
Map::const_iterator MapIterator
Definition: SingletonRegistry.h:35
SingletonRegistry()
C'Tor.
Definition: SingletonRegistry.h:41
static FactoryBase * getFactory(const String &name)
return DefaultParamHandler according to unique identifier name
Definition: SingletonRegistry.h:56
static void registerFactory(const String &name, FactoryBase *instance)
register new concrete Factory
Definition: SingletonRegistry.h:75
virtual ~SingletonRegistry()
destructor
Definition: SingletonRegistry.h:38
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22