35#ifndef Foam_memberFunctionSelectionTables_H
36#define Foam_memberFunctionSelectionTables_H
47#define declareMemberFunctionSelectionTable\
48(returnType,baseType,funcName,argNames,argList,parListUnused) \
50 declareRunTimeSelectionTableBase( \
51 returnType, funcName##argNames##MemberFunction, argList); \
54 template<class baseType##Type> \
55 struct add##funcName##argNames##MemberFunctionToTable \
57 explicit add##funcName##argNames##MemberFunctionToTable \
59 const ::Foam::word& k = baseType##Type::typeName \
62 funcName##argNames##MemberFunctionTablePtr_construct(true); \
65 !funcName##argNames##MemberFunctionTablePtr_ \
66 ->insert(k, baseType##Type::funcName) \
70 << "Duplicate entry " << k << " in member table " \
71 << #baseType << std::endl; \
72 ::Foam::error::safePrintStack(std::cerr); \
76 ~add##funcName##argNames##MemberFunctionToTable() \
78 funcName##argNames##MemberFunctionTablePtr_construct(false); \
81 add##funcName##argNames##MemberFunctionToTable \
82 (const add##funcName##argNames##MemberFunctionToTable&) \
85 (const add##funcName##argNames##MemberFunctionToTable&) \
90 template<class baseType##Type> \
91 struct addRemovable##funcName##argNames##MemberFunctionToTable \
93 const ::Foam::word name; \
95 explicit addRemovable##funcName##argNames##MemberFunctionToTable \
97 const ::Foam::word& k = baseType##Type::typeName \
102 funcName##argNames##MemberFunctionTablePtr_construct(true); \
103 funcName##argNames##MemberFunctionTablePtr_ \
104 ->set(k, baseType##Type::funcName); \
107 ~addRemovable##funcName##argNames##MemberFunctionToTable() \
109 if (funcName##argNames##MemberFunctionTablePtr_) \
111 funcName##argNames##MemberFunctionTablePtr_->erase(name); \
115 addRemovable##funcName##argNames##MemberFunctionToTable \
116 (const addRemovable##funcName##argNames##MemberFunctionToTable&) \
119 (const addRemovable##funcName##argNames##MemberFunctionToTable&) \
124 template<class baseType##Type> \
125 struct addAlias##funcName##argNames##MemberFunctionToTable \
127 explicit addAlias##funcName##argNames##MemberFunctionToTable \
129 const ::Foam::word& k, \
130 const ::Foam::word& alias, \
134 funcName##argNames##MemberFunctionCompatTable() \
135 .set(alias, std::pair<::Foam::word,int>(k,ver)); \
147#define defineMemberFunctionSelectionTable(baseType,funcName,argNames) \
149 defineRunTimeSelectionTableBase( \
150 baseType,baseType::funcName##argNames##MemberFunction,)
155#define defineTemplateMemberFunctionSelectionTable(baseType,funcName,argNames) \
157 defineRunTimeSelectionTableBase( \
158 baseType,baseType::funcName##argNames##MemberFunction,template<>)
163#define defineTemplatedMemberFunctionSelectionTable\
164(baseType,funcName,argNames,Targ) \
166 defineRunTimeSelectionTableBase( \
167 baseType,baseType<Targ>::funcName##argNames##MemberFunction,template<>)
#define defineTemplateMemberFunctionSelectionTable(baseType, funcName, argNames)
Define run-time selection table for template classes.
Macros to ease declaration of run-time selection tables.