FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

addToMemberFunctionSelectionTable.H

Go 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-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::memberFunctionSelectionTables
00026 
00027 Description
00028     Macros for easy insertion into member function selection tables
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef addToMemberFunctionSelectionTable_H
00033 #define addToMemberFunctionSelectionTable_H
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 
00038 // add to hash-table of functions with typename as the key
00039 #define addToMemberFunctionSelectionTable\
00040 (baseType,thisType,memberFunction,argNames)                                   \
00041                                                                               \
00042     /* Add the thisType memberFunction to the table */                        \
00043     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType>  \
00044     add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_
00045 
00046 
00047 
00048 // add to hash-table of functions with 'lookup' as the key
00049 #define addNamedToMemberFunctionSelectionTable\
00050 (baseType,thisType,memberFunction,argNames,lookup)                            \
00051                                                                               \
00052     /* Add the thisType memberFunction to the table, find by lookup name */   \
00053     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType>  \
00054     add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
00055 
00056 
00057 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00058 
00059 
00060 // add to hash-table of functions with typename as the key
00061 // use when baseType doesn't need a template argument (eg, is a typedef)
00062 #define addTemplateToMemberFunctionSelectionTable\
00063 (baseType,thisType,Targ,memberFunction,argNames)                              \
00064                                                                               \
00065     /* Add the thisType memberFunction to the table */                        \
00066     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00067     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_
00068 
00069 
00070 // add to hash-table of functions with 'lookup' as the key
00071 // use when baseType doesn't need a template argument (eg, is a typedef)
00072 #define addNamedTemplateToMemberFunctionSelectionTable\
00073 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
00074                                                                               \
00075     /* Add the thisType memberFunction to the table, find by lookup name */   \
00076     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00077     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
00078 
00079 // use when baseType requires the Targ template argument as well
00080 #define addTemplatedToMemberFunctionSelectionTable\
00081 (baseType,thisType,Targ,memberFunction,argNames)                              \
00082                                                                               \
00083     /* Add the thisType memberFunction to the table */                        \
00084     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00085     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_
00086 
00087 // use when baseType requires the Targ template argument as well
00088 #define addNamedTemplatedToMemberFunctionSelectionTable\
00089 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
00090                                                                               \
00091     /* Add the thisType memberFunction to the table, find by lookup name */   \
00092     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00093     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_(#lookup)
00094 
00095 
00096 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00097 
00098 
00099 // add to hash-table of functions with typename as the key
00100 // use when baseType requires the Targ template argument as well
00101 #define addTemplatedToMemberFunctionSelectionTable\
00102 (baseType,thisType,Targ,memberFunction,argNames)                              \
00103                                                                               \
00104     /* Add the thisType memberFunction to the table */                        \
00105     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00106     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_
00107 
00108 
00109 // add to hash-table of functions with 'lookup' as the key
00110 // use when baseType requires the Targ template argument as well
00111 #define addNamedTemplatedToMemberFunctionSelectionTable\
00112 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
00113                                                                               \
00114     /* Add the thisType memberFunction to the table, find by lookup name */   \
00115     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
00116     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_(#lookup)
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 #endif
00122 
00123 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines