Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Factory Class Template Reference
[Concept]

#include <OpenMS/CONCEPT/Factory.h>

Inheritance diagram for Factory:

FactoryBase

List of all members.


Detailed Description

template<typename FactoryProduct>
class OpenMS::Factory< FactoryProduct >

Returns FactoryProduct* based on the name of the desired concrete FactoryProduct.

Static Public Member Functions

static FactoryProductcreate (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< StringregisteredProducts ()
 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< FactoryProductFactoryType

Private Member Functions

virtual ~Factory ()
 Destructor.
 Factory ()
 Constructor.

Static Private Member Functions

static Factoryinstance_ ()
 singleton access to Factory

Private Attributes

Map inventory_

Static Private Attributes

static Factoryinstance_ptr_ = 0

Friends

class singletonsNeedNoFriends

Member Typedef Documentation

typedef FactoryProduct*(* FunctionType)() [private]

Function signature of creator function.

typedef std::map<String, FunctionType> Map [private]

typedef Map::const_iterator MapIterator [private]

typedef Factory<FactoryProduct> FactoryType [private]


Constructor & Destructor Documentation

virtual ~Factory (  )  [inline, private, virtual]

Destructor.

Factory (  )  [inline, private]

Constructor.


Member Function Documentation

static Factory* instance_ (  )  [inline, static, private]

singleton access to Factory

static FactoryProduct* create ( const String name  )  [inline, static]

return FactoryProduct according to unique identifier name

static void registerProduct ( const String name,
const FunctionType  creator 
) [inline, static]

register new concrete FactoryProduct

Parameters:
name unique name for concrete FactoryProduct
creator default constructor for concrete FactoryProduct

static bool isRegistered ( const String name  )  [inline, static]

Returns if a factory product is registered.

static std::vector<String> registeredProducts (  )  [inline, static]

Returns a list of registered products.


Friends And Related Function Documentation

friend class singletonsNeedNoFriends [friend]


Member Data Documentation

Map inventory_ [private]

Factory< FactoryProduct > * instance_ptr_ = 0 [inline, static, private]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1