public

Inheritance Graph

graph BT
	WrapperFactory
	click WrapperFactory "classUtil_1_1WrapperFactory"

Description

Generic factory for wrapper objects.

The factory template can be instaniated to generate different kinds of factories. The generated factory takes objects of typeInternalType, and generates a wrapper object of typeWrapperType.

Parameters

InternalType
Base type for all objects that are stored inside the wrapper objects of typeWrapperType
WrapperType
Base type for all objects that are generated by the factory
IdentifierType
Type of the identifier that specifies which object creator to call
** ObjectCreator **
Type for callable entities that take an object of typeInternalType, and generate an object of typeWrapperType
FallbackPolicy
Template with a functiononUnknownType()that handles the case that the requested object type was not found

Author: Benjamin Eikel

Date: 2012-01-31

See also: Patterns from Chapter 8 in Andrei Alexandrescu: Modern C++ Design. Addison-Wesley, 2001.

Public Types

   
   
typedef FallbackPolicy< WrapperType, IdentifierType > fallbackPolicy_t

Public Attributes

   
   
fallbackPolicy_t fallbackPolicy

Public Functions

   
   
  WrapperFactory()
   
  WrapperFactory( fallbackPolicy_t policy)
   
bool registerType(const IdentifierType & id, ObjectCreator creator)
   
bool unregisterType(const IdentifierType & id)
   
WrapperType create(const IdentifierType & id, const InternalType & object)

Documentation

typedef
Util::WrapperFactory::fallbackPolicy_t

public
 
 
typedef FallbackPolicy< WrapperType, IdentifierType > fallbackPolicy_t

Defined in Util/Factory/WrapperFactory.h:49


variable
Util::WrapperFactory::fallbackPolicy

public
 
 
fallbackPolicy_t fallbackPolicy

Defined in Util/Factory/WrapperFactory.h:50


function
Util::WrapperFactory::WrapperFactory

public inline
   
   
WrapperFactory( )

Defined in Util/Factory/WrapperFactory.h:51


function
Util::WrapperFactory::WrapperFactory

public inline
     
     
WrapperFactory( fallbackPolicy_t policy )

Defined in Util/Factory/WrapperFactory.h:53


function
Util::WrapperFactory::registerType

public inline
     
     
bool registerType( const IdentifierType & id,
  ObjectCreator creator
)    

Defined in Util/Factory/WrapperFactory.h:56


function
Util::WrapperFactory::unregisterType

public inline
     
     
bool unregisterType( const IdentifierType & id )

Defined in Util/Factory/WrapperFactory.h:60


function
Util::WrapperFactory::create

public inline
     
     
WrapperType create( const IdentifierType & id,
  const InternalType & object
)    

Defined in Util/Factory/WrapperFactory.h:64