Rosetta
Public Types | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
utility::factory::Factory< P > Class Template Reference

Pluggable factory. More...

#include <Factory.hh>

Public Types

typedef P Product
 
typedef Product::FactoryKey Key
 
typedef Product::FactoryKeyP KeyP
 
typedef Product::FactoryKeyFxn KeyFxn
 
typedef Product::FactoryProductP ProductP
 
typedef Product::FactoryArg Arg
 
typedef Product::FactoryCreate Create
 

Static Public Member Functions

static void add (Key const &key, Create create)
 Add a Product to the registry. More...
 
static void add (KeyP const &key_p, Create create)
 Add a Product to the pointer registry. More...
 
static void add (KeyFxn key_fxn, Create create)
 Add a Product to the function registry. More...
 
static void remove (Key const &key)
 Remove a Product from the registry. More...
 
static void remove (KeyP const &key_p)
 Remove a Product from the pointer registry. More...
 
static void remove (KeyFxn key_fxn)
 Remove a Product from the function registry. More...
 
static bool has (Key const &key)
 Has a Product with key? More...
 
static ProductP create (Key const &key)
 Create a Product from key. More...
 
static ProductP create (Key const &key, Arg &arg)
 Create a Product from key and 1 argument. More...
 

Private Types

typedef std::map< Key, CreateRegistry
 
typedef std::map< KeyP, CreatePtrRegistry
 
typedef std::map< KeyFxn, CreateFxnRegistry
 

Private Member Functions

 Factory ()=default
 Default constructor. More...
 

Static Private Member Functions

static Registryregistry ()
 Key registry. More...
 
static PtrRegistryptr_registry ()
 Key pointer registry. More...
 
static FxnRegistryfxn_registry ()
 Key function registry. More...
 
static void ptr_registry_transfer (Registry &reg)
 Transfer key pointer registry to key registry. More...
 
static void fxn_registry_transfer (Registry &reg)
 Transfer key function registry to key registry. More...
 

Detailed Description

template<typename P>
class utility::factory::Factory< P >

Pluggable factory.

Member Typedef Documentation

◆ Arg

template<typename P >
typedef Product::FactoryArg utility::factory::Factory< P >::Arg

◆ Create

template<typename P >
typedef Product::FactoryCreate utility::factory::Factory< P >::Create

◆ FxnRegistry

template<typename P >
typedef std::map< KeyFxn, Create > utility::factory::Factory< P >::FxnRegistry
private

◆ Key

template<typename P >
typedef Product::FactoryKey utility::factory::Factory< P >::Key

◆ KeyFxn

template<typename P >
typedef Product::FactoryKeyFxn utility::factory::Factory< P >::KeyFxn

◆ KeyP

template<typename P >
typedef Product::FactoryKeyP utility::factory::Factory< P >::KeyP

◆ Product

template<typename P >
typedef P utility::factory::Factory< P >::Product

◆ ProductP

template<typename P >
typedef Product::FactoryProductP utility::factory::Factory< P >::ProductP

◆ PtrRegistry

template<typename P >
typedef std::map< KeyP, Create > utility::factory::Factory< P >::PtrRegistry
private

◆ Registry

template<typename P >
typedef std::map< Key, Create > utility::factory::Factory< P >::Registry
private

Constructor & Destructor Documentation

◆ Factory()

template<typename P >
utility::factory::Factory< P >::Factory ( )
inlineprivatedefault

Default constructor.

Member Function Documentation

◆ add() [1/3]

template<typename P >
static void utility::factory::Factory< P >::add ( Key const &  key,
Create  create 
)
inlinestatic

◆ add() [2/3]

template<typename P >
static void utility::factory::Factory< P >::add ( KeyFxn  key_fxn,
Create  create 
)
inlinestatic

◆ add() [3/3]

template<typename P >
static void utility::factory::Factory< P >::add ( KeyP const &  key_p,
Create  create 
)
inlinestatic

◆ create() [1/2]

template<typename P >
static ProductP utility::factory::Factory< P >::create ( Key const &  key)
inlinestatic

◆ create() [2/2]

template<typename P >
static ProductP utility::factory::Factory< P >::create ( Key const &  key,
Arg arg 
)
inlinestatic

◆ fxn_registry()

template<typename P >
static FxnRegistry& utility::factory::Factory< P >::fxn_registry ( )
inlinestaticprivate

◆ fxn_registry_transfer()

template<typename P >
static void utility::factory::Factory< P >::fxn_registry_transfer ( Registry reg)
inlinestaticprivate

◆ has()

template<typename P >
static bool utility::factory::Factory< P >::has ( Key const &  key)
inlinestatic

◆ ptr_registry()

template<typename P >
static PtrRegistry& utility::factory::Factory< P >::ptr_registry ( )
inlinestaticprivate

◆ ptr_registry_transfer()

template<typename P >
static void utility::factory::Factory< P >::ptr_registry_transfer ( Registry reg)
inlinestaticprivate

◆ registry()

template<typename P >
static Registry& utility::factory::Factory< P >::registry ( )
inlinestaticprivate

◆ remove() [1/3]

template<typename P >
static void utility::factory::Factory< P >::remove ( Key const &  key)
inlinestatic

Remove a Product from the registry.

References subloop_histogram::key, and utility::factory::Factory< P >::registry().

◆ remove() [2/3]

template<typename P >
static void utility::factory::Factory< P >::remove ( KeyFxn  key_fxn)
inlinestatic

Remove a Product from the function registry.

References utility::factory::Factory< P >::fxn_registry().

◆ remove() [3/3]

template<typename P >
static void utility::factory::Factory< P >::remove ( KeyP const &  key_p)
inlinestatic

Remove a Product from the pointer registry.

References utility::factory::Factory< P >::ptr_registry().


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