Report patch name instead of index in debug
[foam-extend-3.2.git] / src / foam / db / memberFunctionSelection / addToMemberFunctionSelectionTable.H
blobfc231ecb93323eba2af3c8f8876af38fcd217f02
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 InClass
25     Foam::memberFunctionSelectionTables
27 Description
28     Macros for easy insertion into member function selection tables
30 \*---------------------------------------------------------------------------*/
32 #ifndef addToMemberFunctionSelectionTable_H
33 #define addToMemberFunctionSelectionTable_H
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // add to hash-table of functions with typename as the key
39 #define addToMemberFunctionSelectionTable\
40 (baseType,thisType,memberFunction,argNames)                                   \
41                                                                               \
42     /* Add the thisType memberFunction to the table */                        \
43     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType>  \
44     add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_
48 // add to hash-table of functions with 'lookup' as the key
49 #define addNamedToMemberFunctionSelectionTable\
50 (baseType,thisType,memberFunction,argNames,lookup)                            \
51                                                                               \
52     /* Add the thisType memberFunction to the table, find by lookup name */   \
53     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType>  \
54     add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 // add to hash-table of functions with typename as the key
61 // use when baseType doesn't need a template argument (eg, is a typedef)
62 #define addTemplateToMemberFunctionSelectionTable\
63 (baseType,thisType,Targ,memberFunction,argNames)                              \
64                                                                               \
65     /* Add the thisType memberFunction to the table */                        \
66     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
67     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_
70 // add to hash-table of functions with 'lookup' as the key
71 // use when baseType doesn't need a template argument (eg, is a typedef)
72 #define addNamedTemplateToMemberFunctionSelectionTable\
73 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
74                                                                               \
75     /* Add the thisType memberFunction to the table, find by lookup name */   \
76     baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
77     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
79 // use when baseType requires the Targ template argument as well
80 #define addTemplatedToMemberFunctionSelectionTable\
81 (baseType,thisType,Targ,memberFunction,argNames)                              \
82                                                                               \
83     /* Add the thisType memberFunction to the table */                        \
84     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
85     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_
87 // use when baseType requires the Targ template argument as well
88 #define addNamedTemplatedToMemberFunctionSelectionTable\
89 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
90                                                                               \
91     /* Add the thisType memberFunction to the table, find by lookup name */   \
92     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
93     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_(#lookup)
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 // add to hash-table of functions with typename as the key
100 // use when baseType requires the Targ template argument as well
101 #define addTemplatedToMemberFunctionSelectionTable\
102 (baseType,thisType,Targ,memberFunction,argNames)                              \
103                                                                               \
104     /* Add the thisType memberFunction to the table */                        \
105     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
106     add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_
109 // add to hash-table of functions with 'lookup' as the key
110 // use when baseType requires the Targ template argument as well
111 #define addNamedTemplatedToMemberFunctionSelectionTable\
112 (baseType,thisType,Targ,memberFunction,argNames,lookup)                       \
113                                                                               \
114     /* Add the thisType memberFunction to the table, find by lookup name */   \
115     baseType<Targ>::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
116     add_##lookup##_##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Targ##Table_(#lookup)
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 #endif
123 // ************************************************************************* //