typeInfo.H File Reference
Include dependency graph for typeInfo.H:

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)
 Check if dynamic_cast to Type is possible. 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). Generates a FatalError on failed casts and uses the virtual type() method for error messages. 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...
 

Detailed Description

Original source file typeInfo.H

Definition in file typeInfo.H.

Macro Definition Documentation

◆ TypeNameNoDebug

#define TypeNameNoDebug (   TypeNameString)
Value:
ClassNameNoDebug(TypeNameString); \
virtual const word& type() const { return typeName; }
type
Types of root.
Definition: Roots.H:52
#define ClassNameNoDebug(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:39

Declare a ClassNameNoDebug() with extra virtual type info.

Definition at line 62 of file typeInfo.H.

◆ TypeName

#define TypeName (   TypeNameString)
Value:
ClassName(TypeNameString); \
virtual const word& type() const { return typeName; }
type
Types of root.
Definition: Roots.H:52
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:74

Declare a ClassName() with extra virtual type info.

Definition at line 69 of file typeInfo.H.