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>
126 inline bool isType(
const Type& t)
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);