Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
utility::factory::Factory< typename > Class Template Reference

Pluggable factory. More...

#include <Factory.hh>

Public Types

typedefProduct
 
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>
class utility::factory::Factory< typename >

Pluggable factory.

Member Typedef Documentation

template<typename >
typedef Product::FactoryArg utility::factory::Factory< typename >::Arg
template<typename >
typedef Product::FactoryCreate utility::factory::Factory< typename >::Create
template<typename >
typedef std::map< KeyFxn, Create > utility::factory::Factory< typename >::FxnRegistry
private
template<typename >
typedef Product::FactoryKey utility::factory::Factory< typename >::Key
template<typename >
typedef Product::FactoryKeyFxn utility::factory::Factory< typename >::KeyFxn
template<typename >
typedef Product::FactoryKeyP utility::factory::Factory< typename >::KeyP
template<typename >
typedef P utility::factory::Factory< typename >::Product
template<typename >
typedef Product::FactoryProductP utility::factory::Factory< typename >::ProductP
template<typename >
typedef std::map< KeyP, Create > utility::factory::Factory< typename >::PtrRegistry
private
template<typename >
typedef std::map< Key, Create > utility::factory::Factory< typename >::Registry
private

Constructor & Destructor Documentation

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

Default constructor.

Member Function Documentation

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

Add a Product to the pointer registry.

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

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

Add a Product to the function registry.

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

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

Create a Product from key and 1 argument.

References debug_assert, test.G200_Module_Region::reg, and utility::factory::Factory< typename >::registry().

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

Transfer key function registry to key registry.

References test.T009_Exceptions::e, and utility::factory::Factory< typename >::fxn_registry().

Referenced by utility::factory::Factory< typename >::registry().

template<typename >
static bool utility::factory::Factory< typename >::has ( Key const &  key)
inlinestatic
template<typename >
static PtrRegistry& utility::factory::Factory< typename >::ptr_registry ( )
inlinestaticprivate
template<typename >
static void utility::factory::Factory< typename >::ptr_registry_transfer ( Registry reg)
inlinestaticprivate
template<typename >
static Registry& utility::factory::Factory< typename >::registry ( )
inlinestaticprivate
template<typename >
static void utility::factory::Factory< typename >::remove ( Key const &  key)
inlinestatic
template<typename >
static void utility::factory::Factory< typename >::remove ( KeyP const &  key_p)
inlinestatic

Remove a Product from the pointer registry.

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

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

Remove a Product from the function registry.

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


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