Reflect Reflection Class Hierarchy

From Nocturnal Initiative

Jump to: navigation, search

Contents

Type Class Hierarchy

Alongside the Object Class Hierarchy is the Type Class Hierarchy. This hierarchy of classes store the meta-data reflection information specific to each derived class of Object. These classes store information such as class name, base class names, and derived class names. At a top level it also stores the field information such as name, type, offset, and custom flags.

Reflect::Type

Type is the base class of all classes in the hierarchy. Its stores the name of the type and its unique ID (a signed 32 bit integer).

Reflect::Composite : public Reflect::Type

Composite stores information about what fields a structured data type contains. It makes no decision of the base class of the type with the fields in an effort to support non-Element derived structures in the future.

Composite is where most of the worker code to build field information exists.

Reflect::Class : public Reflect::Composite

Class stores information about a class that derives from Element. It contains a factory function to heap allocate an instance of its compile-time class.

Reflect::Enumeration : public Reflect::Type

Enumeration stores information about enumerated data types. Its stores the string and integral values of each element of an enumeration.

Field Class Hierarchy

Reflect::Field

Field stores information about a field that part of a Composite. It store the name, size, offset, and serializer type for fields. It contains virtual API to allocate an appropriate Serializer. If you include a base pointer it will also connect the Serializer to the field making it ready to use for reading and writing to the field within that instance.

Reflect::EnumerationField : public Reflect::Field

EnumerationField stores a pointer to the Enumeration information for fields of an enumerated type. This pointer exists for the sole purpose of allowing a connected serializers to access the enumerated type's member information.

Personal tools
Navigation
projects