KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::Factory< K, P > Class Template Reference

A pluggable factory. More...

#include <factory.hh>

Public Types

typedef K Key
typedef P Product

Static Public Member Functions

static std::unique_ptr< Product > create (Key key, typename Creator< Product >::Argument arg)
static std::unique_ptr< Product > createAny (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.

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 60 of file factory.hh.

Member Typedef Documentation

◆ Key

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

Definition at line 65 of file factory.hh.

◆ Product

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

Definition at line 66 of file factory.hh.

Member Function Documentation

◆ create()

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

Definition at line 69 of file factory.hh.

◆ createAny()

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

Definition at line 74 of file factory.hh.

◆ plugin()

template<class K, class P>
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.

A previously registered creator for the same key is replaced.

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

Definition at line 90 of file factory.hh.


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