CHROMA
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy > Class Template Reference

Object factory class. More...

#include <funcmap.h>

Inheritance diagram for Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >:
Chroma::DefaultFunctionMapError< IdentifierType, AbstractProduct >

Public Types

typedef TList ParmList
 
typedef TL::TypeAtNonStrict< ParmList, 0, NullType >::Result Parm1
 
typedef TL::TypeAtNonStrict< ParmList, 1, NullType >::Result Parm2
 
typedef TL::TypeAtNonStrict< ParmList, 2, NullType >::Result Parm3
 
typedef TL::TypeAtNonStrict< ParmList, 3, NullType >::Result Parm4
 
typedef TL::TypeAtNonStrict< ParmList, 4, NullType >::Result Parm5
 
typedef TL::TypeAtNonStrict< ParmList, 5, NullType >::Result Parm6
 

Public Member Functions

bool registerFunction (const IdentifierType &id, ProductCall call)
 Register the function. More...
 
bool unregisterFunction (const IdentifierType &id)
 Unregister the function. More...
 
AbstractProduct callFunction (const IdentifierType &id)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1, Parm2 p2)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1, Parm2 p2, Parm3 p3)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5)
 Call the function. More...
 
AbstractProduct callFunction (const IdentifierType &id, Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6)
 Call the function. More...
 

Private Types

typedef std::map< IdentifierType, ProductCall > IdToProductMap
 

Private Attributes

IdToProductMap associations_
 

Additional Inherited Members

- Static Public Member Functions inherited from Chroma::DefaultFunctionMapError< IdentifierType, AbstractProduct >
static AbstractProduct OnUnknownType (const IdentifierType &id)
 

Detailed Description

template<typename Disambiguator, class AbstractProduct, typename IdentifierType, class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
class Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >

Object factory class.

Supports abstract creation of objects

Definition at line 88 of file funcmap.h.

Member Typedef Documentation

◆ IdToProductMap

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef std::map<IdentifierType, ProductCall> Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::IdToProductMap
private

Definition at line 324 of file funcmap.h.

◆ Parm1

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,0,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm1

Definition at line 93 of file funcmap.h.

◆ Parm2

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,1,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm2

Definition at line 94 of file funcmap.h.

◆ Parm3

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,2,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm3

Definition at line 95 of file funcmap.h.

◆ Parm4

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,3,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm4

Definition at line 96 of file funcmap.h.

◆ Parm5

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,4,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm5

Definition at line 97 of file funcmap.h.

◆ Parm6

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TL::TypeAtNonStrict<ParmList,5,NullType>::Result Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::Parm6

Definition at line 98 of file funcmap.h.

◆ ParmList

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
typedef TList Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::ParmList

Definition at line 92 of file funcmap.h.

Member Function Documentation

◆ callFunction() [1/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id)
inline

Call the function.

Parameters
idfunction id
Returns
returns result of the function call

Definition at line 128 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [2/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1 
)
inline

Call the function.

Parameters
idfunction id
p1first parameter arg to function
Returns
returns result of the function call

Definition at line 154 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [3/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1,
Parm2  p2 
)
inline

Call the function.

Parameters
idfunction id
p11st parameter arg to function
p22nd parameter arg to function
Returns
returns result of the function call

Definition at line 181 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [4/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1,
Parm2  p2,
Parm3  p3 
)
inline

Call the function.

Parameters
idfunction id
p11st parameter arg to function
p22nd parameter arg to function
p33rd parameter arg to function
Returns
returns result of the function call

Definition at line 209 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [5/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4 
)
inline

Call the function.

Parameters
idfunction id
p11st parameter arg to function
p22nd parameter arg to function
p33rd parameter arg to function
p44th parameter arg to function
Returns
returns result of the function call

Definition at line 238 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [6/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4,
Parm5  p5 
)
inline

Call the function.

Parameters
idfunction id
p11st parameter arg to function
p22nd parameter arg to function
p33rd parameter arg to function
p44th parameter arg to function
p55th parameter arg to function
Returns
returns result of the function call

Definition at line 269 of file funcmap.h.

References Chroma::i, and j.

◆ callFunction() [7/7]

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
AbstractProduct Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::callFunction ( const IdentifierType &  id,
Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4,
Parm5  p5,
Parm6  p6 
)
inline

Call the function.

Parameters
idfunction id
p11st parameter arg to function
p22nd parameter arg to function
p33rd parameter arg to function
p44th parameter arg to function
p55th parameter arg to function
p66th parameter arg to function
Returns
returns result of the function call

Definition at line 301 of file funcmap.h.

References Chroma::i, and j.

◆ registerFunction()

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
bool Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::registerFunction ( const IdentifierType &  id,
ProductCall  call 
)
inline

Register the function.

Parameters
idfunction id
callthe calling function
Returns
returns true if registration successful

Definition at line 107 of file funcmap.h.

◆ unregisterFunction()

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
bool Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::unregisterFunction ( const IdentifierType &  id)
inline

Unregister the function.

Parameters
idfunction id
Returns
returns true if function was registered before

Definition at line 118 of file funcmap.h.

Member Data Documentation

◆ associations_

template<typename Disambiguator , class AbstractProduct , typename IdentifierType , class TList = NullType, typename ProductCall = AbstractProduct (*)(), template< typename, class > class FunctionMapErrorPolicy = DefaultFunctionMapError>
IdToProductMap Chroma::FunctionMap< Disambiguator, AbstractProduct, IdentifierType, TList, ProductCall, FunctionMapErrorPolicy >::associations_
private

Definition at line 325 of file funcmap.h.


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