#include <SerializeContext.h>
Public Member Functions | |
AZ_TYPE_INFO_WITH_NAME_DECL (ClassData) | |
ClassData (ClassData &&)=default | |
ClassData & | operator= (ClassData &&)=default |
bool | IsDeprecated () const |
void | ClearAttributes () |
Attribute * | FindAttribute (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. | |
IObjectFactory * | m_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. | |
IEventHandler * | m_eventHandler |
Optional interface for Event notification (start/stop serialization, etc.) | |
IDataContainer * | m_container |
Interface if this class represents a data container. Data will be accessed using this interface. | |
IRttiHelper * | m_azRtti |
Interface used to support RTTI. Set internally based on type provided to Class<T>. | |
IDataConverter * | m_dataConverter {} |
Interface used to convert unrelated types to elements of this class. | |
Edit::ClassData * | m_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, AZStdFunctorAllocator > | m_attributes { AZStdFunctorAllocator(&GetSystemAllocator) } |
SerializeContext::CreateAnyActionHandler | m_createAzStdAnyActionHandler |
Class Data contains the data/info for each registered class all if it members (their offsets, etc.), creator, version converts, etc.
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
resultPtr | output parameter that is populated with the memory address that can be used to store an element of the convertible type |
convertibleTypeId | type to check to determine if it can converted to an element of class represent by this Class Data |
classPtr | memory address of the class represented by the ClassData |
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
convertibleTypeId | type to check to determine if it can converted to an element of class represent by this Class Data |
SerializeContext::ClassPersistentId AZ::Serialize::ClassData::GetPersistentId | ( | const SerializeContext & | context | ) | const |
Find the persistence id (check base classes)
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
pointer | to SerializeContext which is used for type-erased operations for non-copyable types |
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