|
|
|
addToRunTimeSelectionTable.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 InClass 00026 Foam::runTimeSelectionTables 00027 00028 Description 00029 Macros for easy insertion into run-time selection tables 00030 00031 \*---------------------------------------------------------------------------*/ 00032 00033 #ifndef addToRunTimeSelectionTable_H 00034 #define addToRunTimeSelectionTable_H 00035 00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00037 00038 00039 // add to hash-table of functions with typename as the key 00040 #define addToRunTimeSelectionTable\ 00041 (baseType,thisType,argNames) \ 00042 \ 00043 /* Add the thisType constructor function to the table */ \ 00044 baseType::add##argNames##ConstructorToTable< thisType > \ 00045 add##thisType##argNames##ConstructorTo##baseType##Table_ 00046 00047 00048 // add to hash-table of functions with 'lookup' as the key 00049 #define addNamedToRunTimeSelectionTable\ 00050 (baseType,thisType,argNames,lookup) \ 00051 \ 00052 /* Add the thisType constructor function to the table, find by lookup */ \ 00053 baseType::add##argNames##ConstructorToTable< thisType > \ 00054 add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup) 00055 00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00057 00058 00059 // add to hash-table of functions with typename as the key 00060 // use when baseType doesn't need a template argument (eg, is a typedef) 00061 #define addTemplateToRunTimeSelectionTable\ 00062 (baseType,thisType,Targ,argNames) \ 00063 \ 00064 /* Add the thisType constructor function to the table */ \ 00065 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \ 00066 add##thisType##Targ##argNames##ConstructorTo##baseType##Table_ 00067 00068 00069 // add to hash-table of functions with 'lookup' as the key 00070 // use when baseType doesn't need a template argument (eg, is a typedef) 00071 #define addNamedTemplateToRunTimeSelectionTable\ 00072 (baseType,thisType,Targ,argNames,lookup) \ 00073 \ 00074 /* Add the thisType constructor function to the table, find by lookup */ \ 00075 baseType::add##argNames##ConstructorToTable< thisType< Targ > > \ 00076 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Table_(#lookup) 00077 00078 00079 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00080 00081 00082 // add to hash-table of functions with typename as the key 00083 // use when baseType requires the Targ template argument as well 00084 #define addTemplatedToRunTimeSelectionTable\ 00085 (baseType,thisType,Targ,argNames) \ 00086 \ 00087 /* Add the thisType constructor function to the table */ \ 00088 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \ 00089 add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_ 00090 00091 00092 // add to hash-table of functions with 'lookup' as the key 00093 // use when baseType requires the Targ template argument as well 00094 #define addNamedTemplatedToRunTimeSelectionTable\ 00095 (baseType,thisType,Targ,argNames,lookup) \ 00096 \ 00097 /* Add the thisType constructor function to the table, find by lookup */ \ 00098 baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \ 00099 add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_(#lookup) 00100 00101 00102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00103 00104 #endif 00105 00106 // ************************************************************************* // |