Menu
Lumberyard
C++ API Reference (Version 1.10)

Contains all the information about a class that is reflected to the behavior context. More...

Public Types

using AllocateType
 A type of function to override the default memory allocator. More...
 
using DeallocateType
 A type of function to override the default memory deallocator. More...
 
using DefaultConstructorType
 A type of function to use as the default constructor. More...
 
using DestructorType
 A type of function to use as the default destructor. More...
 
using CopyContructorType
 A type of function to clone an object to an existing address. More...
 
using MoveContructorType
 A type of function to move an object to an existing address. More...
 

Public Member Functions

 BehaviorClass ()
 A constructor. More...
 
 ~BehaviorClass ()
 A destructor. More...
 
BehaviorObject Create () const
 Creates an object and uses the default constructor, if possible. More...
 
BehaviorObject Clone (const BehaviorObject &object) const
 Clones an object. More...
 
BehaviorObject Move (BehaviorObject &&object) const
 Moves an object. More...
 
void Destroy (const BehaviorObject &object) const
 Calls the destructor and frees all the memory of an object. More...
 
void * Allocate () const
 Allocates memory for an object without calling a constructor. More...
 
void Deallocate (void *address) const
 Frees the memory for an object without calling a destructor. More...
 

Public Attributes

AllocateType m_allocate
 A function that overrides the default memory allocator of the reflected class. More...
 
DeallocateType m_deallocate
 A function that overrides the default memory deallocator of the reflected class. More...
 
DefaultConstructorType m_defaultConstructor
 A function to use as the default constructor for the reflected class. More...
 
AZStd::vector< BehaviorMethod * > m_constructors
 A vector of constructors for the reflected class. More...
 
DestructorType m_destructor
 A function to use as the default destructor for the reflected class. More...
 
CopyContructorType m_cloner
 A function that clones objects of the reflected class. More...
 
MoveContructorType m_mover
 A function that moves objects of the reflected class. More...
 
void * m_userData
 Additional information attached to the reflected class. More...
 
AZStd::string m_name
 The name of the reflected class. More...
 
AZStd::vector< AZ::Uuid > m_baseClasses
 A vector that identifies all the base classes of the reflected class. More...
 
AZStd::unordered_map< AZStd::string, BehaviorMethod * > m_methods
 A map of all the methods that the class reflects to the behavior context. More...
 
AZStd::list< BehaviorMethod * > m_attributeMethods
 A list of methods that are generated for setting generic attributes. More...
 
AZStd::unordered_map< AZStd::string, BehaviorProperty * > m_properties
 A map of all the properties that the class reflects to the behavior context. More...
 
AttributeArray m_attributes
 An array of all the attributes that the class reflects to the behavior context. More...
 
AZStd::unordered_set< OnDemandReflectionFunction > m_onDemandReflection
 The on-demand reflection function of the class so that the class can be unreflected when needed. More...
 
AZStd::unordered_set< AZStd::string > m_requestBuses
 A set of all the request buses that the class reflects to the behavior context. More...
 
AZStd::unordered_set< AZStd::string > m_notificationBuses
 A set of all the notification buses that the class reflects to the behavior context. More...
 
AZ::Uuid m_typeId
 The unique type ID of the reflected class. More...
 
IRttiHelper * m_azRtti
 The interface for resolving run-time type information for the class when type information is not available at compile time. More...
 
size_t m_alignment
 The alignment of the reflected class, in bytes. More...
 
size_t m_size
 The size of the reflected class, in bytes. More...
 
BehaviorClassUnwrapperFunction m_unwrapper
 A callback function for unwrapping the reflected class. More...
 
void * m_unwrapperUserData
 A pointer to additional information for unwrapping the reflected class. More...
 
AZ::Uuid m_wrappedTypeId
 The unique ID of the wrapped type. More...
 

Detailed Description

Contains all the information about a class that is reflected to the behavior context.

An instance of this type is the end result of calling AZ::BehaviorContext::ClassReflection methods to reflect a class. The instance is stored in the behavior context along with instances for all the other reflected classes.

Member Typedef Documentation

◆ AllocateType

using AZ::BehaviorClass::AllocateType = void*(*)(void* userData)

A type of function to override the default memory allocator.

◆ CopyContructorType

using AZ::BehaviorClass::CopyContructorType = void(*)(void* address, const void* sourceObjectPtr, void* userData)

A type of function to clone an object to an existing address.

◆ DeallocateType

using AZ::BehaviorClass::DeallocateType = void(*)(void* address, void* userData)

A type of function to override the default memory deallocator.

◆ DefaultConstructorType

using AZ::BehaviorClass::DefaultConstructorType = void(*)(void* address, void* userData)

A type of function to use as the default constructor.

◆ DestructorType

using AZ::BehaviorClass::DestructorType = void(*)(void* objectPtr, void* userData)

A type of function to use as the default destructor.

◆ MoveContructorType

using AZ::BehaviorClass::MoveContructorType = void(*)(void* address, void* sourceObjectPtr, void* userData)

A type of function to move an object to an existing address.

Constructor & Destructor Documentation

◆ BehaviorClass()

AZ::BehaviorClass::BehaviorClass ( )

A constructor.

◆ ~BehaviorClass()

AZ::BehaviorClass::~BehaviorClass ( )

A destructor.

Member Function Documentation

◆ Allocate()

void* AZ::BehaviorClass::Allocate ( ) const

Allocates memory for an object without calling a constructor.

If you want to both allocate memory and create an object, use Create() or Clone().

◆ Clone()

BehaviorObject AZ::BehaviorClass::Clone ( const BehaviorObject &  object) const

Clones an object.

Parameters
objectA reference to the object to clone.
Returns
The new object that was created from the existing object.

◆ Create()

BehaviorObject AZ::BehaviorClass::Create ( ) const

Creates an object and uses the default constructor, if possible.

Otherwise, returns an invalid object.

Returns
The new object. If the operation did not succeed, this is an invalid object.

◆ Deallocate()

void AZ::BehaviorClass::Deallocate ( void *  address) const

Frees the memory for an object without calling a destructor.

If you want to both free memory and call a destructor, use Destroy().

Parameters
Apointer to the object for which to free memory.

◆ Destroy()

void AZ::BehaviorClass::Destroy ( const BehaviorObject &  object) const

Calls the destructor and frees all the memory of an object.

Parameters
objectA reference to the object to destroy.

◆ Move()

BehaviorObject AZ::BehaviorClass::Move ( BehaviorObject &&  object) const

Moves an object.

Parameters
objectA reference to the object to move.
Returns
The object that was moved.

Member Data Documentation

◆ m_alignment

size_t AZ::BehaviorClass::m_alignment

The alignment of the reflected class, in bytes.

◆ m_allocate

AllocateType AZ::BehaviorClass::m_allocate

A function that overrides the default memory allocator of the reflected class.

◆ m_attributeMethods

AZStd::list<BehaviorMethod*> AZ::BehaviorClass::m_attributeMethods

A list of methods that are generated for setting generic attributes.

◆ m_attributes

AttributeArray AZ::BehaviorClass::m_attributes

An array of all the attributes that the class reflects to the behavior context.

◆ m_azRtti

IRttiHelper* AZ::BehaviorClass::m_azRtti

The interface for resolving run-time type information for the class when type information is not available at compile time.

◆ m_baseClasses

AZStd::vector<AZ::Uuid> AZ::BehaviorClass::m_baseClasses

A vector that identifies all the base classes of the reflected class.

◆ m_cloner

CopyContructorType AZ::BehaviorClass::m_cloner

A function that clones objects of the reflected class.

◆ m_constructors

AZStd::vector<BehaviorMethod*> AZ::BehaviorClass::m_constructors

A vector of constructors for the reflected class.

◆ m_deallocate

DeallocateType AZ::BehaviorClass::m_deallocate

A function that overrides the default memory deallocator of the reflected class.

◆ m_defaultConstructor

DefaultConstructorType AZ::BehaviorClass::m_defaultConstructor

A function to use as the default constructor for the reflected class.

◆ m_destructor

DestructorType AZ::BehaviorClass::m_destructor

A function to use as the default destructor for the reflected class.

◆ m_methods

AZStd::unordered_map<AZStd::string, BehaviorMethod*> AZ::BehaviorClass::m_methods

A map of all the methods that the class reflects to the behavior context.

◆ m_mover

MoveContructorType AZ::BehaviorClass::m_mover

A function that moves objects of the reflected class.

◆ m_name

AZStd::string AZ::BehaviorClass::m_name

The name of the reflected class.

◆ m_notificationBuses

AZStd::unordered_set<AZStd::string> AZ::BehaviorClass::m_notificationBuses

A set of all the notification buses that the class reflects to the behavior context.

◆ m_onDemandReflection

AZStd::unordered_set<OnDemandReflectionFunction> AZ::BehaviorClass::m_onDemandReflection

The on-demand reflection function of the class so that the class can be unreflected when needed.

◆ m_properties

AZStd::unordered_map<AZStd::string, BehaviorProperty*> AZ::BehaviorClass::m_properties

A map of all the properties that the class reflects to the behavior context.

◆ m_requestBuses

AZStd::unordered_set<AZStd::string> AZ::BehaviorClass::m_requestBuses

A set of all the request buses that the class reflects to the behavior context.

◆ m_size

size_t AZ::BehaviorClass::m_size

The size of the reflected class, in bytes.

◆ m_typeId

AZ::Uuid AZ::BehaviorClass::m_typeId

The unique type ID of the reflected class.

◆ m_unwrapper

BehaviorClassUnwrapperFunction AZ::BehaviorClass::m_unwrapper

A callback function for unwrapping the reflected class.

◆ m_unwrapperUserData

void* AZ::BehaviorClass::m_unwrapperUserData

A pointer to additional information for unwrapping the reflected class.

◆ m_userData

void* AZ::BehaviorClass::m_userData

Additional information attached to the reflected class.

◆ m_wrappedTypeId

AZ::Uuid AZ::BehaviorClass::m_wrappedTypeId

The unique ID of the wrapped type.


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