Dynamic

class ReflectExport(reflect) Dynamic

This class defines the core interface for all runtime type identification (RTTI) in reflect.

The two facets of building an RTTI system are

  • Building a class hierarchy, and
  • Accessing the class hierarchy.

In reflect, the class hierarchy is partially constructed using static initialization, and finalized using an explicit call (<Class.LoadClasses>) to avoid the pitfalls of static initialization order.

The static initialization is facilitated by the method Dynamic::TheClass, and a macro in Reflection.hpp.

Accessing the hierarchy is done through the virtual function GetClass, which always returns the result of TheClass() but is accessed through the Dynamic’s virtual table.

In order to keep the particular type of Class consistent, Dynamics also typedef the ClassType so that subclasses can inherit it.

Summary
DynamicThis class defines the core interface for all runtime type identification (RTTI) in reflect.
Types
ClassTypeThe type of Class which reflects the castable.
Functions
GetClassThe dynamic Class of the castable.
TheClassThis function is always hidden by subclasses and used during static construction to construct the class hierarchy.
~DynamicDeclare virtual to allow correct deletion of castable.
Function(name)Returns a Function which represents the named function.
DynamicDeclared protected because there’s no good reason to make a plain Dynamic.

Types

ClassType

typedef Class ClassType

The type of Class which reflects the castable.

Note

This typedef can be hidden by subclasses to represent a change in the class type.

Functions

GetClass

virtual ClassType *GetClass() const

Returns

The dynamic Class of the castable.

TheClass

static ClassType *TheClass()

This function is always hidden by subclasses and used during static construction to construct the class hierarchy.

Returns

The static class of the castable.

~Dynamic

virtual ~Dynamic()

Declare virtual to allow correct deletion of castable.

Function(name)

const function::Function *Function(string::Fragment function_name) const

Returns a Function which represents the named function.

Dynamic

Dynamic()

Declared protected because there’s no good reason to make a plain Dynamic.

class ReflectExport(reflect) Dynamic
This class defines the core interface for all runtime type identification (RTTI) in reflect.
typedef Class ClassType
The type of Class which reflects the castable.
virtual ClassType *GetClass() const
The dynamic Class of the castable.
class ReflectExport(reflect) Class : public ObjectType
static ClassType *TheClass()
This function is always hidden by subclasses and used during static construction to construct the class hierarchy.
virtual ~Dynamic()
Declare virtual to allow correct deletion of castable.
const function::Function *Function(string::Fragment function_name) const
Returns a Function which represents the named function.
class ReflectExport(reflect) Function
A function object provides a virtual inteface to a function.
Dynamic()
Declared protected because there’s no good reason to make a plain Dynamic.
Support for defining reflection for types.
Close