Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Serialize::ClassData Class Reference

#include <SerializeContext.h>

Public Member Functions

 AZ_TYPE_INFO_WITH_NAME_DECL (ClassData)
 
 ClassData (ClassData &&)=default
 
ClassDataoperator= (ClassData &&)=default
 
bool IsDeprecated () const
 
void ClearAttributes ()
 
AttributeFindAttribute (AttributeId attributeId) const
 
bool CanConvertFromType (const TypeId &convertibleTypeId, AZ::SerializeContext &serializeContext) const
 
bool ConvertFromType (void *&convertibleTypePtr, const TypeId &convertibleTypeId, void *classPtr, AZ::SerializeContext &serializeContext) const
 
SerializeContext::ClassPersistentId GetPersistentId (const SerializeContext &context) const
 Find the persistence id (check base classes)
 

Static Public Member Functions

template<class T >
static ClassData Create (const char *name, const Uuid &typeUuid, IObjectFactory *factory, IDataSerializer *serializer=nullptr, IDataContainer *container=nullptr)
 

Public Attributes

const char * m_name
 
Uuid m_typeId
 
unsigned int m_version
 Data version (by default 0)
 
SerializeContext::VersionConverter m_converter
 Data version converter, a static member that should not need an instance to convert it's data.
 
IObjectFactorym_factory
 Interface for object creation.
 
SerializeContext::ClassPersistentId m_persistentId
 Function to retrieve class instance persistent Id.
 
SerializeContext::ClassDoSave m_doSave
 Function what will choose to Save or not an instance.
 
IDataSerializerPtr m_serializer
 Interface for actual data serialization. If this is not NULL m_elements must be empty.
 
IEventHandlerm_eventHandler
 Optional interface for Event notification (start/stop serialization, etc.)
 
IDataContainerm_container
 Interface if this class represents a data container. Data will be accessed using this interface.
 
IRttiHelperm_azRtti
 Interface used to support RTTI. Set internally based on type provided to Class<T>.
 
IDataConverterm_dataConverter {}
 Interface used to convert unrelated types to elements of this class.
 
Edit::ClassDatam_editData
 Edit data for the class display.
 
ClassElementArray m_elements
 Sub elements. If this is not empty m_serializer should be NULL (there is no point to have sub-elements, if we can serialize the entire class).
 
SerializeContext::DataPatchUpgradeHandler m_dataPatchUpgrader
 
AZStd::vector< AttributeSharedPair, AZStdFunctorAllocatorm_attributes { AZStdFunctorAllocator(&GetSystemAllocator) }
 
SerializeContext::CreateAnyActionHandler m_createAzStdAnyActionHandler
 

Detailed Description

Class Data contains the data/info for each registered class all if it members (their offsets, etc.), creator, version converts, etc.

Member Function Documentation

◆ CanConvertFromType()

bool AZ::Serialize::ClassData::CanConvertFromType ( const TypeId convertibleTypeId,
AZ::SerializeContext serializeContext 
) const

Retrieves a memory address that can be used store an element of the convertible type

Parameters
resultPtroutput parameter that is populated with the memory address that can be used to store an element of the convertible type
convertibleTypeIdtype to check to determine if it can converted to an element of class represent by this Class Data
classPtrmemory address of the class represented by the ClassData
Returns
true if a non-null memory address has been returned that can store the convertible type

◆ FindAttribute()

Attribute * AZ::Serialize::ClassData::FindAttribute ( AttributeId  attributeId) const

Checks if the supplied typeid can be converted to an instance of the class represented by this Class Data

Parameters
convertibleTypeIdtype to check to determine if it can converted to an element of class represent by this Class Data
Returns
if the classData can store the convertible type element true is returned

◆ GetPersistentId()

SerializeContext::ClassPersistentId AZ::Serialize::ClassData::GetPersistentId ( const SerializeContext context) const

Find the persistence id (check base classes)

Member Data Documentation

◆ m_createAzStdAnyActionHandler

SerializeContext::CreateAnyActionHandler AZ::Serialize::ClassData::m_createAzStdAnyActionHandler

Functor object which can be used to initialize the AZStd::any::type_info in order to allow it to construct, destruct, copy/move instances of the stored type in a type-erased manner This can be used with the any(const void* pointer, const type_info& typeInfo) extension constructor to construct an AZStd::any without access to the C++ type at that point

Parameters
pointerto SerializeContext which is used for type-erased operations for non-copyable types

◆ m_dataPatchUpgrader

SerializeContext::DataPatchUpgradeHandler AZ::Serialize::ClassData::m_dataPatchUpgrader

Attributes for this class type. Lambda is required here as AZStdFunctorAllocator expects a function pointer that returns an IAllocator& and the AZ::AllocatorInstance<AZ::SystemAllocator>::Get returns an AZ::SystemAllocator& which while it inherits from IAllocator, does not work as function pointers do not support covariant return types


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