OpenMS
2.7.0
|
Returns FactoryProduct* based on the name of the desired concrete FactoryProduct. More...
#include <OpenMS/CONCEPT/Factory.h>
Static Public Member Functions | |
static FactoryProduct * | create (const String &name) |
return FactoryProduct according to unique identifier name More... | |
static void | registerProduct (const String &name, const FunctionType creator) |
register new concrete FactoryProduct More... | |
static bool | isRegistered (const String &name) |
Returns if a factory product is registered. More... | |
static std::vector< String > | registeredProducts () |
Returns a list of registered products. More... | |
Private Types | |
typedef FactoryProduct *(* | FunctionType) () |
Function signature of creator function. More... | |
typedef std::map< String, FunctionType > | Map |
typedef Map::const_iterator | MapIterator |
typedef Factory< FactoryProduct > | FactoryType |
Private Member Functions | |
~Factory () override | |
Destructor. More... | |
Factory () | |
Constructor. More... | |
Static Private Member Functions | |
static Factory * | instance_ () |
singleton access to Factory More... | |
Private Attributes | |
Map | inventory_ |
Static Private Attributes | |
static Factory * | instance_ptr_ = nullptr |
Friends | |
class | singletonsNeedNoFriends |
Additional Inherited Members | |
Public Member Functions inherited from FactoryBase | |
virtual | ~FactoryBase () |
destructor More... | |
Returns FactoryProduct* based on the name of the desired concrete FactoryProduct.
Every factory product base class T has to implement the static function registerChildren that registers all classes S derived from T at Factory<T>.
Every class S derived from T has to implement the function "static T* create()" which is going to be registered at Factory<T>. Additionally the function "static String getProductName()" is required, which returns the name the class is registered by.
|
private |
|
private |
Function signature of creator function.
|
private |
|
private |
|
inlineoverrideprivate |
Destructor.
|
inlineprivate |
Constructor.
Referenced by Factory< FactoryProduct >::instance_().
|
inlinestatic |
return FactoryProduct according to unique identifier name
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
|
inlinestaticprivate |
singleton access to Factory
References Factory< FactoryProduct >::Factory(), SingletonRegistry::getFactory(), Factory< FactoryProduct >::instance_ptr_, SingletonRegistry::isRegistered(), and SingletonRegistry::registerFactory().
Referenced by Factory< FactoryProduct >::create(), Factory< FactoryProduct >::isRegistered(), Factory< FactoryProduct >::registeredProducts(), and Factory< FactoryProduct >::registerProduct().
|
inlinestatic |
Returns if a factory product is registered.
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
|
inlinestatic |
Returns a list of registered products.
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
|
inlinestatic |
register new concrete FactoryProduct
name | unique name for concrete FactoryProduct |
creator | default constructor for concrete FactoryProduct |
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
Referenced by QApplicationTOPP::QApplicationTOPP(), and BaseLabeler::registerChildren().
|
friend |
|
staticprivate |
Referenced by Factory< FactoryProduct >::instance_().
|
private |