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::SerializeContext::EnumBuilder Class Reference

#include <SerializeContext.h>

Public Member Functions

auto operator-> () -> EnumBuilder *
 
template<class EnumType >
auto Value (const char *name, EnumType value) -> EnumBuilder *
 Declare enum field with a specific value.
 
auto Version (unsigned int version, VersionConverter converter=nullptr) -> EnumBuilder *
 Add version control to the structure with optional converter. If not controlled a version of 0 is assigned.
 
auto Serializer (Serialize::IDataSerializerPtr serializer) -> EnumBuilder *
 For data types (usually base types) or types that we handle the full serialize, implement this interface.
 
template<typename SerializerImplementation >
auto Serializer () -> EnumBuilder *
 Helper function to create a static instance of specific serializer implementation. Serializer(IDataSerializer*)
 
auto EventHandler (IEventHandler *eventHandler) -> EnumBuilder *
 
template<typename EventHandlerImplementation >
auto EventHandler () -> EnumBuilder *
 Helper function to create a static instance of specific event handler implementation. Serializer(IDataSerializer*)
 
auto DataContainer (IDataContainer *dataContainer) -> EnumBuilder *
 Adds a DataContainer structure for manipulating contained data in custom ways.
 
template<typename DataContainerType >
auto DataContainer () -> EnumBuilder *
 Helper function to create a static instance of the specific data container implementation. DataContainer(IDataContainer*)
 
auto PersistentId (ClassPersistentId persistentId) -> EnumBuilder *
 
template<class T >
auto Attribute (Crc32 idCrc, T &&value) -> EnumBuilder *
 

Friends

class SerializeContext
 

Detailed Description

Internal structure to maintain enum information while we are describing a enum type. This can be used to name the values of the enumeration for serialization. example: enum MyEnum { First, Second, Fourth = 4 };

expose for serialization serializeContext->Enum<MyEnum>() ->Value("First",&MyEnum::First) ->Value("Second",&MyEnum::Second) ->Value("Fourth",&MyEnum::Fourth);

Member Function Documentation

◆ Attribute()

template<class T >
auto AZ::SerializeContext::EnumBuilder::Attribute ( Crc32  idCrc,
T &&  value 
) -> EnumBuilder*

All T (attribute value) MUST be copy or move constructible as they are stored in internal AttributeContainer<T>, which can be accessed by azrtti and AttributeData. Attributes can be assigned to either classes or DataElements.

◆ EventHandler()

auto AZ::SerializeContext::EnumBuilder::EventHandler ( IEventHandler eventHandler) -> EnumBuilder *

Implement and provide interface for event handling when necessary. An example for this will be when the class does some thread work and need to know when we are about to access data for serialization (load/save).

◆ PersistentId()

auto AZ::SerializeContext::EnumBuilder::PersistentId ( ClassPersistentId  persistentId) -> EnumBuilder *

Sets the class persistent ID function getter. This is used when we store the class in containers, so we can identify elements for the purpose of overriding values (aka slices overrides), otherwise the ability to tweak complex types in containers will be limiting due to the lack of reliable ways to address elements in a container.


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