From 0473f177ad73bab0087bd068d4e8cb4be731bcc9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 20 Jul 2008 15:19:07 +0200 Subject: [PATCH] Create unique member name for addNamed...SelectionTable We can now add the same member function with different lookups e.g. 'stl' and 'stlb' By using leading/trailing underscores around the lookup name, we get a unique name and avoid possible collision with other classes. --- .../addToMemberFunctionSelectionTable.H | 7 +++---- .../db/runTimeSelection/addToRunTimeSelectionTable.H | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/db/memberFunctionSelection/addToMemberFunctionSelectionTable.H b/src/OpenFOAM/db/memberFunctionSelection/addToMemberFunctionSelectionTable.H index 5d6b78db47..7bfd089dc3 100644 --- a/src/OpenFOAM/db/memberFunctionSelection/addToMemberFunctionSelectionTable.H +++ b/src/OpenFOAM/db/memberFunctionSelection/addToMemberFunctionSelectionTable.H @@ -26,7 +26,7 @@ InClass Foam::memberFunctionSelectionTables Description - Macros to enable the easy insertion into member function selection tables. + Macros for easy insertion into member function selection tables \*---------------------------------------------------------------------------*/ @@ -47,14 +47,13 @@ Description \ /* Add the thisType constructor function to the table */ \ baseType::add##memberFunction##argNames##MemberFunctionToTable \ - add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup) + add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup) #define addTemplateToMemberFunctionSelectionTable\ (baseType,thisType,Targ,memberFunction,argNames) \ \ /* Add the thisType constructor function to the table */ \ - baseType::add##memberFunction##argNames##MemberFunctionToTable \ - > \ + baseType::add##memberFunction##argNames##MemberFunctionToTable > \ add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_ diff --git a/src/OpenFOAM/db/runTimeSelection/addToRunTimeSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/addToRunTimeSelectionTable.H index b3bbf50cb7..3a1d74e28a 100644 --- a/src/OpenFOAM/db/runTimeSelection/addToRunTimeSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/addToRunTimeSelectionTable.H @@ -26,7 +26,7 @@ InClass Foam::runTimeSelectionTables Description - Macros to enable the easy insertion into run-time selection tables. + Macros for easy insertion into run-time selection tables \*---------------------------------------------------------------------------*/ @@ -45,7 +45,7 @@ Description \ /* Add the thisType constructor function to the table */ \ baseType::add##argNames##ConstructorToTable \ - add##thisType##argNames##ConstructorTo##baseType##Table_(#lookup) + add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup) #define addTemplateToRunTimeSelectionTable(baseType,thisType,Targ,argNames) \ \