KASKADE 7 development version
Public Types | Static Public Member Functions | List of all members
Kaskade::Factory< K, P > Class Template Reference

A pluggable factory. More...

#include <factory.hh>

Detailed Description

template<class K, class P>
class Kaskade::Factory< K, P >

A pluggable factory.

Template Parameters
Kthe key type the values of which specify which product is to be created
Pthe product type
See also
Creator

Definition at line 58 of file factory.hh.

Public Types

typedef K Key
 
typedef P Product
 

Static Public Member Functions

static std::unique_ptr< Productcreate (Key key, typename Creator< Product >::Argument arg)
 
static std::unique_ptr< ProductcreateAny (typename Creator< Product >::Argument arg)
 
static void plugin (Key key, Creator< Product > const *creator)
 Registers a creator for creation of Product objects with the given. More...
 

Member Typedef Documentation

◆ Key

template<class K , class P >
typedef K Kaskade::Factory< K, P >::Key

Definition at line 63 of file factory.hh.

◆ Product

template<class K , class P >
typedef P Kaskade::Factory< K, P >::Product

Definition at line 64 of file factory.hh.

Member Function Documentation

◆ create()

template<class K , class P >
static std::unique_ptr< Product > Kaskade::Factory< K, P >::create ( Key  key,
typename Creator< Product >::Argument  arg 
)
inlinestatic

Definition at line 67 of file factory.hh.

◆ createAny()

template<class K , class P >
static std::unique_ptr< Product > Kaskade::Factory< K, P >::createAny ( typename Creator< Product >::Argument  arg)
inlinestatic

Definition at line 72 of file factory.hh.

◆ plugin()

template<class K , class P >
static void Kaskade::Factory< K, P >::plugin ( Key  key,
Creator< Product > const *  creator 
)
inlinestatic

Registers a creator for creation of Product objects with the given.

  • key.

Note that the creator object has to exist for the whole lifetime of the program.

Definition at line 86 of file factory.hh.


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