Menu
Lumberyard
C++ API Reference (Version 1.10)

Reflection API Reference

Reflection is the means by which classes describe the data and functions that they contain. In Lumberyard, you reflect classes to different contexts for different purposes. The following links to Lumberyard C++ API documentation provide information about reflecting classes to the following contexts:

  • Edit Context – To make a class's data editable in Lumberyard Editor, you reflect the data to the edit context. For example, an animation component might reflect its playback speed member variable so that users can change that value from the editor.

  • Serialize Context – To enable class objects to be saved to persistent storage and reconstructed in memory, you reflect the class's information to the serialize context. For example, your game might enable users to save the level state to a disk. To load the level, Lumberyard must have the information it needs to reconstruct the relevant classes in memory.

  • Behavior Context – To enable Lumberyard to interact with objects during run time, you reflect class information to the behavior context. The behavior context enables scripts (such as Lua scripts) to change the state of objects during a game.

To reflect a class to these contexts, you add code to the class's implementation of the Reflect() function. For more information, see EditContext, SerializeContext, and BehaviorContext.

To learn how to reflect component classes, see Reflecting a Component for Serialization and Editing in the Lumberyard Developer Guide.

Header Files

BehaviorContext.h
Header file for the behavior context, which contains information about classes, methods, properties, enums, constants, and EBuses to enable Lumberyard to interact with objects during run time.
EditContext.h
Header file for the edit context, which you use to make class data editable in the Lumberyard editor.
EditContextConstants.inl
Defines constants that you can use when you reflect class and data attributes to Lumberyard's global edit context.
ReflectContext.h
Header file for the reflection context and attribute base classes, which enable types to provide information about their contents.
RTTI.h
Header file for AZ RTTI, which is a lightweight, user-defined run-time type information (RTTI) system with which you can determine the type of an object during run time.
SerializeContext.h
Header file for the serialize context, which manages information about every class that needs to be saved to persistent storage and reconstructed in memory.
TypeInfo.h
Header file for AzTypeInfo, which uniquely describes a type so that it can be identified across Lumberyard modules and serialized into different contexts.

Classes/Structs

Attribute
Base class for all attributes that are used by reflection contexts.
AttributeData< T >
A generic attribute that contains data that is stored by value.
AttributeFunction< F >
A generic attribute that contains a pointer to a global function.
AttributeFunction< R(Args...)>
An attribute that contains a pointer to a global function with the specified arguments and return type.
AttributeMemberData< T >
A generic attribute that points to class member data.
AttributeMemberData< T C::* >
An attribute that points to class member data of a specified class type.
AttributeMemberFunction< R(C::*)(Args...) const >
An attribute that contains a pointer to a const class member function with the specified arguments and return type.
AttributeMemberFunction< R(C::*)(Args...)>
An attribute that contains a pointer to a class member function with the specified arguments and return type.
AttributeMemberFunction< T >
A generic attribute that contains a pointer to a class member function.
AzTypeInfo< R(Args...), false >
Specialization of AzTypeInfo for function pointers.
AzTypeInfo< T, false >
Specialization of AzTypeInfo for types that use AZ_TYPE_INFO to add type information to the class.
AzTypeInfo< T, true >
Default specialization of AzTypeInfo for enums that do not contain AzTypeInfo.
BehaviorClass
Contains all the information about a class that is reflected to the behavior context.
BehaviorContext
BehaviorContext is an object that contains information about classes, methods, properties, constants, enums, and EBuses to enable Lumberyard to interact with objects during run time.
BehaviorContextEvents
Interface for the AZ::BehaviorContextBus, which is the EBus that dispatches behavior context events.
ClassData
This structure is built up and stored in the edit context while you are calling EditContext::ClassInfo functions to reflect a class's data to the edit context.
ClassData
This structure is built up and stored in the serialize context while you are calling SerializeContext::ClassInfo functions to reflect a class's data to the serialize context.
ClassElement
A subelement of a class that is reflected to the serialize context.
ClassInfo
Builder class that reflects class data to the edit context.
ClassInfo
Builder class that reflects class members to the serialize context.
ClassReflection< C >
This structure is built up while you call ClassReflection functions to reflect a class's information to the behavior context.
DataElement
Represents an element within the tree of serialized data.
DataElementNode
Represents a node in the tree of serialized data.
DbgStackEntry
A debug stack element that provides useful debugging information as Lumberyard traverses through the class hierarchy to serialize data.
EBusReflection< Bus >
This structure is built up while you call EBusReflection functions to reflect an EBus's information to the behavior context.
EditContext
You use the EditContext to make class data editable in the Lumberyard editor.
ElementData
A named group of attributes.
EnumInfo
Builder class that reflects global enum data to the edit context.
ErrorHandler
Reports errors and warnings as Lumberyard serializes data.
IEventHandler
You can use this class if you want special functions to run before reading or writing a class.
ReflectContext
Base class for all reflection contexts.
SerializeContext
The serialize context contains information about every Lumberyard class that might need to be saved to persistent storage and reconstructed in memory.

Functions

FindAttribute (AttributeId id, const AttributeArray &attrArray)
Finds an attribute within an array of attributes.
operator!= (AzTypeInfo< T > const &lhs, AzTypeInfo< U > const &rhs)
Compares the AzTypeInfo of two type instances for inequality.
operator== (AzTypeInfo< T > const &lhs, AzTypeInfo< U > const &rhs)
Compares the AzTypeInfo of two type instances for equality.

Macros

AZ_EBUS_BEHAVIOR_BINDER (_Handler, _Uuid, _Allocator, ...)
Macro that helps you write the handler class that forwards EBus notification events to handlers that are created by the behavior context.
AZ_RTTI (...)
Adds run-time type information to a class.
AZ_TYPE_INFO (...)
A macro that you add to your class to enable the class to be identified across modules and serialized into different contexts.
AZ_TYPE_INFO_SPECIALIZE (_ClassName, _ClassUuid)
AzTypeInfo specialization macro that is used to externally add AzTypeInfo to a type that cannot use the AZ_RTTI/AZ_TYPE_INFO macros internally.
azdynamic_cast
Use azrtti_cast, which is the same, instead.
azrtti_cast
Casts a pointer from one polymorphic type to another.
azrtti_istypeof
Returns true if the input type is of the specified type or derived from the specified type.
azrtti_typeid
Returns the ID of the specified type.
BehaviorConstant (value)
Generates a function that gets a constant.
BehaviorValueGetter (valueAddress)
Generates a function that gets a value.
BehaviorValueProperty (valueAddress)
Creates getter and setter functions for a value.
BehaviorValueSetter (valueAddress)
Generates a function that sets a value.