public

Inheritance Graph

graph BT
	DefaultCreatorFallback
	click DefaultCreatorFallback "classUtil_1_1FallbackPolicies_1_1DefaultCreatorFallback"

Description

Possible fallback policy for a factory.

In case of an unknown type, a default object is constructed. The default object is requested from the factory by using the specified identifier. An error message is output to the given stream.

See also: Factory or WrapperFactory for description of template parameters

Author: Benjamin Eikel

Date: 2012-02-01

Public Types

   
   
typedef std::function< ObjectType(const IdentifierType &)> FactoryCall
Type of a function object that encapsulates a call to the factory that uses this fallback.

Public Functions

   
   
  DefaultCreatorFallback(const IdentifierType & id, std::ostream & outputStream)
   
ObjectType onUnknownType( FactoryCall functor, const IdentifierType & id)

Documentation

typedef
Util::FallbackPolicies::DefaultCreatorFallback::FactoryCall

public
 
 
typedef std::function< ObjectType(const IdentifierType &)> FactoryCall

Type of a function object that encapsulates a call to the factory that uses this fallback.

Defined in Util/Factory/FallbackPolicies.h:101


function
Util::FallbackPolicies::DefaultCreatorFallback::DefaultCreatorFallback

public inline
     
     
DefaultCreatorFallback( const IdentifierType & id,
  std::ostream & outputStream
)    

Defined in Util/Factory/FallbackPolicies.h:96


function
Util::FallbackPolicies::DefaultCreatorFallback::onUnknownType

public inline
     
     
ObjectType onUnknownType( FactoryCall functor,
  const IdentifierType & id
)    

Use the given function object calling the create function of the factory. Give the default identifier to the create function to create a default object.

Defined in Util/Factory/FallbackPolicies.h:107