Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to cover I/O. More...
Go to the source code of this file.
Classes | |
struct | isAOp< Type > |
Test if dynamic_cast to Type is possible, as a functor. More... | |
struct | isTypeOp< Type > |
Test if typeid is identical to the Type, as a functor. More... | |
Namespaces | |
Foam | |
Namespace for OpenFOAM. | |
Macros | |
#define | TypeNameNoDebug(TypeNameString) |
Declare a ClassNameNoDebug() with extra virtual type info. More... | |
#define | TypeName(TypeNameString) |
Declare a ClassName() with extra virtual type info. More... | |
Functions | |
template<class Type , class U > | |
const Type * | isA (const U &obj) |
Attempt dynamic_cast to Type . More... | |
template<class Type , class U > | |
Type * | isA_constCast (const U &obj) |
Attempt dynamic_cast to Type followed by a const_cast of the result. More... | |
template<class Type , class U > | |
bool | isType (const U &obj) |
Check if typeid of the object and Type are identical. More... | |
template<class Type , class U > | |
Type & | dynamicCast (U &obj) |
A dynamic_cast (for references) that generates FatalError on failed casts. More... | |
template<class Type , class U > | |
Type & | dynamicCast (U &obj, const dictionary &dict) |
A dynamic_cast (for references) that generates FatalIOError on failed casts. More... | |
template<class Type , class U > | |
Type & | refCast (U &obj) |
A dynamic_cast (for references) to Type reference. More... | |
template<class Type , class U > | |
Type & | refConstCast (const U &obj) |
A dynamic_cast (for const references) to Type reference, followed by a const_cast of the result. More... | |
template<class Type , class U > | |
Type & | refCast (U &obj, const dictionary &dict) |
A dynamic_cast (for references) that generates FatalIOError on failed casts, uses the virtual type() method for error messages. More... | |
template<class Type , class U > | |
Type & | refCast (U &obj, const label index) |
A dynamic_cast (for references) that generates FatalError on failed casts, uses the virtual type() method for error messages. The index can be used to convey additional context. More... | |
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to cover I/O.
Original source file typeInfo.H
The user can get the type's type name using the type info access function
The isA functions:
which return const or non-const pointers to the cast object, nullptr if cast is not possible (can be tested as a bool).
The reference type cast template function:
wraps dynamic_cast to handle failed casts and generate a FatalError.
Definition in file typeInfo.H.
#define TypeNameNoDebug | ( | TypeNameString | ) |
Declare a ClassNameNoDebug() with extra virtual type info.
Definition at line 61 of file typeInfo.H.
#define TypeName | ( | TypeNameString | ) |
Declare a ClassName() with extra virtual type info.
Definition at line 68 of file typeInfo.H.