Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
1d272333
Commit
1d272333
authored
Jan 12, 2009
by
Mark Olesen
Browse files
className.H - remove old macro versions (were surrounded by #if 0 ... #endif)
parent
c2ac216e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/typeInfo/className.H
View file @
1d272333
...
...
@@ -52,7 +52,7 @@ Description
inline const char* typeName_() { return TypeNameString; } \
extern const ::Foam::word typeName;
//- Add typeName information from argument @a T
yp
eNameString to a template class.
//- Add typeName information from argument @a T
emplat
eNameString to a template class.
// Without debug information.
#define TemplateNameNoDebug(TemplateNameString) \
class TemplateNameString##Name \
...
...
@@ -189,68 +189,6 @@ public: \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#if 0 // PREVIOUS DEFINITIONS
//- Adds typeName information from its argument @a TypeNameString to a class
#define ClassName(TypeNameString) \
static const char* typeName_() { return TypeNameString; } \
static const ::Foam::word typeName; \
static int debug
#define NamespaceName(TypeNameString) \
inline const char* typeName_() { return TypeNameString; } \
extern const ::Foam::word typeName; \
extern int debug
#define TemplateName(template) \
class template##Name \
{ \
public: \
\
template##Name() \
{} \
\
ClassName(#template); \
};
#define defineTypeNameAndDebug(Type, DebugSwitch) \
const ::Foam::word Type::typeName(Type::typeName_()); \
int Type::debug(::Foam::debug::debugSwitch(Type::typeName_(), DebugSwitch));
#ifdef __INTEL_COMPILER
#define defineTemplateTypeNameAndDebugWithName(Type, Name, DebugSwitch) \
const ::Foam::word Type::typeName(Name); \
int Type::debug(::Foam::debug::debugSwitch(Name, DebugSwitch));
#else
#define defineTemplateTypeNameAndDebugWithName(Type, Name, DebugSwitch) \
template<> \
const ::Foam::word Type::typeName(Name); \
template<> \
int Type::debug(::Foam::debug::debugSwitch(Name, DebugSwitch));
#endif
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch) \
defineTemplateTypeNameAndDebugWithName(Type, #Type, DebugSwitch);
#ifdef __INTEL_COMPILER
#define defineNamedTemplateTypeNameAndDebug(Type, DebugSwitch) \
const ::Foam::word Type::typeName(Type::typeName_()); \
int Type::debug(::Foam::debug::debugSwitch(Type::typeName_(), DebugSwitch));
#else
#define defineNamedTemplateTypeNameAndDebug(Type, DebugSwitch) \
template<> \
const ::Foam::word Type::typeName(Type::typeName_()); \
template<> \
int Type::debug(::Foam::debug::debugSwitch(Type::typeName_(), DebugSwitch));
#endif
#endif // OLD DEFINITIONS
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
src/OpenFOAM/db/typeInfo/typeInfo.H
View file @
1d272333
...
...
@@ -60,12 +60,14 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// declarations for use in header files
// declarations
(
for use in header files
)
//- Declare a ClassNameNoDebug() with extra virtual type info
#define TypeNameNoDebug(TypeNameString) \
ClassNameNoDebug(TypeNameString); \
virtual const word& type() const { return typeName; }
//- Declare a ClassName() with extra virtual type info
#define TypeName(TypeNameString) \
ClassName(TypeNameString); \
virtual const word& type() const { return typeName; }
...
...
@@ -78,9 +80,8 @@ namespace Foam
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
// Reference type cast template function wraps dynamic_cast to handle the
// bad_cast exception and generate a FatalError.
//- Reference type cast template function,
// wraps dynamic_cast to handle bad_cast exception and generate a FatalError.
template
<
class
To
,
class
From
>
inline
To
&
dynamicCast
(
From
&
r
)
{
...
...
@@ -100,6 +101,8 @@ inline To& dynamicCast(From& r)
}
//- Reference type cast template function.
// As per dynamicCast, but handles type names via the virtual type() method.
template
<
class
To
,
class
From
>
inline
To
&
refCast
(
From
&
r
)
{
...
...
@@ -119,6 +122,7 @@ inline To& refCast(From& r)
}
//- Check the typeid
template
<
class
TestType
,
class
Type
>
inline
bool
isType
(
const
Type
&
t
)
{
...
...
@@ -126,6 +130,7 @@ inline bool isType(const Type& t)
}
//- Check if a dynamic_cast to typeid is possible
template
<
class
TestType
,
class
Type
>
inline
bool
isA
(
const
Type
&
t
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment