00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 InClass 00025 Foam::runTimeSelectionTables 00026 00027 Description 00028 Macros for easy insertion into run-time selection tables 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #ifndef addToRunTimeSelectionTable_H 00033 #define addToRunTimeSelectionTable_H 00034 00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00036 00037 00038 // add to hash-table of functions with typename as the key 00039 #define addToRunTimeSelectionTable\ 00040 (baseType,thisType,argNames) \ 00041 \ 00042 /* Add the thisType constructor function to the table */ \ 00043 baseType::add##argNames##ConstructorToTable< thisType > \ 00044 add##thisType##argNames##ConstructorTo##baseType##Table_ 00045 00046 00047 // add to hash-table of functions with 'lookup' as the key 00048 #define addNamedToRunTimeSelectionTable\ 00049 (baseType,thisType,argNames,lookup) \ 00050 \ 00051 /* Add the thisType constructor function to the table, find by lookup */ \ 00052 baseType::add##argNames##ConstructorToTable< thisType > \ 00053 add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup) 00054 00055 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00056 00057 00058 // add to hash-table of functions with typename as the key 00059 // use when baseType doesn't need a template argument (eg, is a typedef) 00060 #define addTemplateToRunTimeSelectionTable\ 00061 (baseType,thisType,Targ,argNames) \ 00062 \ 00063 /* Add the thisType constructor function to the table */ \ 00064 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \ 00065 add##thisType##Targ##argNames##ConstructorTo##baseType##Table_ 00066 00067 00068 // add to hash-table of functions with 'lookup' as the key 00069 // use when baseType doesn't need a template argument (eg, is a typedef) 00070 #define addNamedTemplateToRunTimeSelectionTable\ 00071 (baseType,thisType,Targ,argNames,lookup) \ 00072 \ 00073 /* Add the thisType constructor function to the table, find by lookup */ \ 00074 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \ 00075 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Table_(#lookup) 00076 00077 00078 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00079 00080 00081 // add to hash-table of functions with typename as the key 00082 // use when baseType requires the Targ template argument as well 00083 #define addTemplatedToRunTimeSelectionTable\ 00084 (baseType,thisType,Targ,argNames) \ 00085 \ 00086 /* Add the thisType constructor function to the table */ \ 00087 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \ 00088 add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_ 00089 00090 00091 // add to hash-table of functions with 'lookup' as the key 00092 // use when baseType requires the Targ template argument as well 00093 #define addNamedTemplatedToRunTimeSelectionTable\ 00094 (baseType,thisType,Targ,argNames,lookup) \ 00095 \ 00096 /* Add the thisType constructor function to the table, find by lookup */ \ 00097 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \ 00098 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_(#lookup) 00099 00100 00101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00102 00103 #endif 00104 00105 // ************************ vim: set sw=4 sts=4 et: ************************ //