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 | |
| static void | registerProduct (const String &name, const FunctionType creator) |
| register new concrete FactoryProduct | |
| static bool | isRegistered (const String &name) |
| Returns if a factory product is registered. | |
| static std::vector< String > | registeredProducts () |
| Returns a list of registered products. | |
Private Types | |
| typedef FactoryProduct *(* | FunctionType )() |
| Function signature of creator function. | |
| typedef std::map< String, FunctionType > | Map |
| typedef Map::const_iterator | MapIterator |
| typedef Factory< FactoryProduct > | FactoryType |
Private Member Functions | |
| virtual | ~Factory () |
| Destructor. | |
| Factory () | |
| Constructor. | |
Static Private Member Functions | |
| static Factory * | instance_ () |
| singleton access to Factory | |
Private Attributes | |
| Map | inventory_ |
Static Private Attributes | |
| static Factory * | instance_ptr_ = 0 |
Friends | |
| class | singletonsNeedNoFriends |
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.
typedef Factory<FactoryProduct> FactoryType [private] |
typedef FactoryProduct*(* FunctionType)() [private] |
Function signature of creator function.
typedef std::map<String, FunctionType> Map [private] |
typedef Map::const_iterator MapIterator [private] |
| virtual ~Factory | ( | ) | [inline, private, virtual] |
Destructor.
| Factory | ( | ) | [inline, private] |
Constructor.
Referenced by Factory< FactoryProduct >::instance_().
| static FactoryProduct* create | ( | const String & | name | ) | [inline, static] |
return FactoryProduct according to unique identifier name
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
| static Factory* instance_ | ( | ) | [inline, static, private] |
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().
| static bool isRegistered | ( | const String & | name | ) | [inline, static] |
Returns if a factory product is registered.
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
| static std::vector<String> registeredProducts | ( | ) | [inline, static] |
Returns a list of registered products.
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
| static void registerProduct | ( | const String & | name, | |
| const FunctionType | creator | |||
| ) | [inline, static] |
register new concrete FactoryProduct
| name | unique name for concrete FactoryProduct | |
| creator | default constructor for concrete FactoryProduct |
References Factory< FactoryProduct >::instance_(), and Factory< FactoryProduct >::inventory_.
friend class singletonsNeedNoFriends [friend] |
Factory< FactoryProduct > * instance_ptr_ = 0 [static, private] |
Referenced by Factory< FactoryProduct >::instance_().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:51 using doxygen 1.7.1 |