Open 3D Engine AzCore API Reference  22.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
AZ::Attribute Class Reference

#include <ReflectContext.h>

Inherited by AZ::AttributeData< T >, AZ::AttributeFunction< R(Args...)>, and AZ::AttributeInvocable< Invocable >.

Public Types

using ContextDeleter = void(*)(void *contextData)
 

Public Member Functions

 AZ_RTTI (AZ::Attribute, "{2C656E00-12B0-476E-9225-5835B92209CC}")
 
void SetContextData (void *contextData, ContextDeleter destroyer)
 
void * GetContextData () const
 
virtual bool IsInvokable () const
 Returns true if this attribute is an invokable function or method.
 
virtual bool CanDomInvoke ([[maybe_unused]] const AZ::Dom::Value &arguments) const
 
virtual AZ::Dom::Value DomInvoke ([[maybe_unused]] void *instance, [[maybe_unused]] const AZ::Dom::Value &arguments)
 
virtual AZ::Dom::Value GetAsDomValue ([[maybe_unused]] void *instance)
 

Public Attributes

bool m_describesChildren = false
 
bool m_childClassOwned = false
 

Static Public Attributes

static const AZ::Name s_typeField
 
static constexpr AZStd::string_view s_typeName = "AZ::Attribute"
 
static const AZ::Name s_instanceField
 
static const AZ::Name s_attributeField
 

Detailed Description

Base abstract class for all attributes. Use azrtti to get the appropriate version. Of course if NULL there is a data mismatch of attributes.

Member Function Documentation

◆ CanDomInvoke()

virtual bool AZ::Attribute::CanDomInvoke ( [[maybe_unused] ] const AZ::Dom::Value arguments) const
inlinevirtual

Returns true if this attribute is invokable, given a set of arguments.

Parameters
argumentsA Dom::Value that must contain an Array of arguments for this invokable attribute.

Reimplemented in AZ::AttributeMemberFunction< R(C::*)(Args...)>, and AZ::AttributeFunction< R(Args...)>.

◆ DomInvoke()

virtual AZ::Dom::Value AZ::Attribute::DomInvoke ( [[maybe_unused] ] void *  instance,
[[maybe_unused] ] const AZ::Dom::Value arguments 
)
inlinevirtual

Attempts to execute this attribute given an array of Dom::Values as parameters.

Parameters
argumentsA Dom::Value that must contain an Array of arguments for this invokable attribute.
Returns
A Dom::Value containing the marshalled result of the function call (null if the call returned void)

◆ GetAsDomValue()

virtual AZ::Dom::Value AZ::Attribute::GetAsDomValue ( [[maybe_unused] ] void *  instance)
inlinevirtual

Gets a marshaleld Dom::Value representation of this attribute bound to a given instance. By default this just serializes a pointer to the instance and this attribute, but for non-invokable attributes this is just abbreviated to a marshalled version of the data stored in the attribute.


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