OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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