Go to the documentation of this file.
65 #define TypeNameNoDebug(TypeNameString) \
66 ClassNameNoDebug(TypeNameString); \
67 virtual const word& type() const { return typeName; }
70 #define TypeName(TypeNameString) \
71 ClassName(TypeNameString); \
72 virtual const word& type() const { return typeName; }
84 template<
class To,
class From>
89 return dynamic_cast<To&
>(r);
94 <<
"Attempt to cast type " <<
typeid(r).
name()
95 <<
" to type " <<
typeid(To).
name()
98 return dynamic_cast<To&
>(r);
105 template<
class To,
class From>
110 return dynamic_cast<To&
>(r);
112 catch (std::bad_cast)
115 <<
"Attempt to cast type " << r.type()
116 <<
" to type " << To::typeName
119 return dynamic_cast<To&
>(r);
125 template<
class TestType,
class Type>
128 return typeid(t) ==
typeid(TestType);
133 template<
class TestType,
class Type>
134 inline bool isA(
const Type& t)
136 return dynamic_cast<const TestType*
>(&t);
Macro definitions for declaring ClassName(), NamespaceName(), etc.
errorManip< error > abort(error &err)
To & refCast(From &r)
Reference type cast template function.
bool isType(const Type &t)
Check the typeid.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
To & dynamicCast(From &r)
Reference type cast template function,.
word name(const complex &)
Return a string representation of a complex.