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 | |
| namespace | Foam |
| Namespace for OpenFOAM. | |
Macros | |
| #define | TypeNameNoDebug(TypeNameString) |
| Declare a ClassNameNoDebug() with extra virtual type info. | |
| #define | TypeName(TypeNameString) |
| Declare a ClassName() with extra virtual type info. | |
Functions | |
| template<class Type, class U> | |
| const Type * | isA (const U &obj) |
Attempt dynamic_cast to Type. | |
| template<class Type, class U> | |
| Type * | isA_constCast (const U &obj) |
Attempt dynamic_cast to Type followed by a const_cast of the result. | |
| template<class Type, class U> | |
| bool | isType (const U &obj) |
Check if typeid of the object and Type are identical. | |
| template<class Type, class U> | |
| Type & | dynamicCast (U &obj) |
| A dynamic_cast (for references) that generates FatalError on failed casts. | |
| template<class Type, class U> | |
| Type & | dynamicCast (U &obj, const dictionary &dict) |
| A dynamic_cast (for references) that generates FatalIOError on failed casts. | |
| template<class Type, class U> | |
| Type & | refCast (U &obj) |
A dynamic_cast (for references) to Type reference. | |
| 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. | |
| 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. | |
| 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. | |
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.