runTimeSelection/memberFunctionSelection templated forms

- useful when the baseType isn't a typedef and thus requires the same
   template argument as the derived class
This commit is contained in:
Mark Olesen
2008-11-13 17:45:19 +01:00
parent 9a2c1adb79
commit 8ffb89dab0
4 changed files with 137 additions and 98 deletions

View File

@ -35,31 +35,52 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define addToRunTimeSelectionTable(baseType,thisType,argNames) \
#define addToRunTimeSelectionTable\
(baseType,thisType,argNames) \
\
/* Add the thisType constructor function to the table */ \
baseType::add##argNames##ConstructorToTable<thisType> \
add##thisType##argNames##ConstructorTo##baseType##Table_
#define addNamedToRunTimeSelectionTable(baseType,thisType,argNames,lookup) \
#define addNamedToRunTimeSelectionTable\
(baseType,thisType,argNames,lookup) \
\
/* Add the thisType constructor function to the table */ \
/* Add the thisType constructor function to the table, find by lookup */ \
baseType::add##argNames##ConstructorToTable<thisType> \
add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup)
#define addTemplateToRunTimeSelectionTable(baseType,thisType,Targ,argNames) \
// use when baseType doesn't need a template argument (eg, is a typedef)
#define addTemplateToRunTimeSelectionTable\
(baseType,thisType,Targ,argNames) \
\
/* Add the thisType constructor function to the table */ \
baseType::add##argNames##ConstructorToTable<thisType<Targ> > \
add##thisType##Targ##argNames##ConstructorTo##baseType##Table_
// use when baseType doesn't need a template argument (eg, is a typedef)
#define addNamedTemplateToRunTimeSelectionTable\
(baseType,thisType,Targ,argNames,lookup) \
\
/* Add the thisType constructor function to the table */ \
/* Add the thisType constructor function to the table, find by lookup */ \
baseType::add##argNames##ConstructorToTable<thisType<Targ> > \
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Table_(#lookup)
// use when baseType requires the Targ template argument as well
#define addTemplatedToRunTimeSelectionTable\
(baseType,thisType,Targ,argNames) \
\
/* Add the thisType constructor function to the table */ \
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ> > \
add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_
// use when baseType requires the Targ template argument as well
#define addNamedTemplatedToRunTimeSelectionTable\
(baseType,thisType,Targ,argNames,lookup) \
\
/* Add the thisType constructor function to the table, find by lookup */ \
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ> > \
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_(#lookup)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif