Gaia
gaia2::Factory< IdentifierType, AbstractProduct, ArgumentType > Class Template Reference

A basic implementation of a generic factory class. More...

#include <factory.h>

Inheritance diagram for gaia2::Factory< IdentifierType, AbstractProduct, ArgumentType >:
gaia2::ParamCheckingFactory< IdentifierType, AbstractProduct, ArgumentType >

Classes

class  Registrar
 

Public Member Functions

AbstractProduct * create_i (const IdentifierType &id, const ArgumentType &arg) const
 

Static Public Member Functions

static Factoryinstance ()
 
static AbstractProduct * create (const IdentifierType &id, const ArgumentType &arg=ArgumentType())
 
static QStringList keys ()
 

Protected Types

typedef AbstractProduct *(* ProductCreator) (const ArgumentType &)
 
typedef QMap< IdentifierType, ProductCreator > CreatorMap
 

Protected Attributes

CreatorMap _map
 

Detailed Description

template<typename IdentifierType, typename AbstractProduct, typename ArgumentType>
class gaia2::Factory< IdentifierType, AbstractProduct, ArgumentType >

A basic implementation of a generic factory class.

We can choose the identifier type (usually string) and the base type that we want to implement. Registration is done via the creation of a static object of type Factory<IdentifierType, AbstractProduct>::Registrar<ConcreteProduct>. There is also a third template parameter that can be used, the type of an optional argument. That means we will be able to call: Factory::create("PCA", "dim=3");


The documentation for this class was generated from the following file: