1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::runTimeSelectionTables
29 Macros for easy insertion into run-time selection tables
31 \*---------------------------------------------------------------------------*/
33 #ifndef addToRunTimeSelectionTable_H
34 #define addToRunTimeSelectionTable_H
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // add to hash-table of functions with typename as the key
40 #define addToRunTimeSelectionTable\
41 (baseType,thisType,argNames) \
43 /* Add the thisType constructor function to the table */ \
44 baseType::add##argNames##ConstructorToTable< thisType > \
45 add##thisType##argNames##ConstructorTo##baseType##Table_
48 // add to hash-table of functions with 'lookup' as the key
49 #define addNamedToRunTimeSelectionTable\
50 (baseType,thisType,argNames,lookup) \
52 /* Add the thisType constructor function to the table, find by lookup */ \
53 baseType::add##argNames##ConstructorToTable< thisType > \
54 add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup)
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 // add to hash-table of functions with typename as the key
60 // use when baseType doesn't need a template argument (eg, is a typedef)
61 #define addTemplateToRunTimeSelectionTable\
62 (baseType,thisType,Targ,argNames) \
64 /* Add the thisType constructor function to the table */ \
65 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \
66 add##thisType##Targ##argNames##ConstructorTo##baseType##Table_
69 // add to hash-table of functions with 'lookup' as the key
70 // use when baseType doesn't need a template argument (eg, is a typedef)
71 #define addNamedTemplateToRunTimeSelectionTable\
72 (baseType,thisType,Targ,argNames,lookup) \
74 /* Add the thisType constructor function to the table, find by lookup */ \
75 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \
76 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Table_(#lookup)
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 // add to hash-table of functions with typename as the key
83 // use when baseType requires the Targ template argument as well
84 #define addTemplatedToRunTimeSelectionTable\
85 (baseType,thisType,Targ,argNames) \
87 /* Add the thisType constructor function to the table */ \
88 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \
89 add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_
92 // add to hash-table of functions with 'lookup' as the key
93 // use when baseType requires the Targ template argument as well
94 #define addNamedTemplatedToRunTimeSelectionTable\
95 (baseType,thisType,Targ,argNames,lookup) \
97 /* Add the thisType constructor function to the table, find by lookup */ \
98 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \
99 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_(#lookup)
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 // ************************************************************************* //