Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::ReflectContext Class Reference

Base class for all reflection contexts. More...

Inherited by AZ::BehaviorContext, and AZ::SerializeContext.

Public Member Functions

 ReflectContext ()
 Initializes a reflection context instance. More...
 
virtual ~ReflectContext ()
 An empty destructor. More...
 
void EnableRemoveReflection ()
 Sets the behavior such that calls to this context remove reflection for types passed to it. More...
 
void DisableRemoveReflection ()
 Sets the behavior such that calls to this context add reflection for types passed to it. More...
 
bool IsRemovingReflection () const
 Indicates whether calls to this context remove reflection for types passed to it. More...
 

Detailed Description

Base class for all reflection contexts.

A reflection context is an object that contains information about a type for a particular purpose. A type can be reflected into multiple contexts. For example, to make the properties of a component editable in the Lumberyard editor, you reflect its properties to an edit context. To enable the component to be manipulated during runtime, you reflect its methods to a behavior context. To enable the component to be constructed and stored, you reflect its data fields to a serialize context.

We recommend that you use the following declarative format for all contexts:

context->Class<TYPE>("Descriptive parameters")
->Field/Property("Field name",&TYPE::m_field)
->Method("Method name"),&TYPE::Method)
...

This is only for direct C++ interfaces. Code generators generate code on top of this interface.

We recommend that all reflection context implementations provide a way to remove reflection when a reflected class or descriptor is deleted. To do so, make sure that when IsRemovingReflection() returns true, any calls to Class<...>() remove reflection.

Constructor & Destructor Documentation

◆ ReflectContext()

AZ::ReflectContext::ReflectContext ( )
inline

Initializes a reflection context instance.

◆ ~ReflectContext()

virtual AZ::ReflectContext::~ReflectContext ( )
inlinevirtual

An empty destructor.

Member Function Documentation

◆ DisableRemoveReflection()

void AZ::ReflectContext::DisableRemoveReflection ( )
inline

Sets the behavior such that calls to this context add reflection for types passed to it.

This is the default behavior.

◆ EnableRemoveReflection()

void AZ::ReflectContext::EnableRemoveReflection ( )
inline

Sets the behavior such that calls to this context remove reflection for types passed to it.

◆ IsRemovingReflection()

bool AZ::ReflectContext::IsRemovingReflection ( ) const
inline

Indicates whether calls to this context remove reflection for types passed to it.

Returns
True if calls to this context remove reflection for types passed to it. Otherwise, false.

The documentation for this class was generated from the following file: