Open 3D Engine ScriptEvents Gem 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.
ScriptEventData::VersionedProperty Class Reference

#include <VersionedProperty.h>

Classes

struct  VersionSort
 

Public Member Functions

 AZ_RTTI (VersionedProperty, "{828CA9C0-32F1-40B3-8018-EE7C3C38192A}")
 
 AZ_CLASS_ALLOCATOR (VersionedProperty, AZ::SystemAllocator)
 
 VersionedProperty (AZStd::string label)
 
 VersionedProperty (const VersionedProperty &rhs)
 
 VersionedProperty (VersionedProperty &&rhs)
 
VersionedPropertyoperator= (const VersionedProperty &rhs)
 
 VersionedProperty (AZ::ScriptDataContext &)
 
AZ::Uuid GetType () const
 
void SetLabel (const char *label)
 
AZStd::string GetLabel () const
 
bool operator== (const VersionedProperty &rhs) const
 
AZStd::string ToString () const
 
bool operator!= (const VersionedProperty &rhs) const
 
void IncreaseVersion ()
 
void Get (AZ::ScriptDataContext &dc)
 
void Set (AZ::ScriptDataContext &dc)
 
bool IsEmpty () const
 
template<typename T >
void Set (T &&data)
 Data can only be set into a property through this function.
 
template<typename T >
const T * Get () const
 Returns the latest version of the property.
 
template<typename T >
bool Get (T &out) const
 
template<typename T >
T * Get ()
 
void Set (const char *str)
 
VersionedPropertyNewVersion ()
 Creates a new version of the desired property.
 
void OnPropertyChange ()
 
void Flatten ()
 
void ApplyLatestVersions ()
 
AZ::Uuid GetId () const
 
AZ::u32 GetVersion () const
 
const AZStd::vector< VersionedProperty > & GetVersions () const
 
const AZStd::any & GetRaw () const
 
template<typename T >
void SetDefaultFromType ()
 
void PreSave ()
 

Static Public Member Functions

static VersionedProperty MakeVoid ()
 
template<typename T >
static VersionedProperty Make (T t, const char *label)
 
static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

A VersionedProperty holds a default or starting value and a list of versions. The list of versions is immutable until the moment the property is flattened. Flattening a property discards all versioning information but the latest and can be used when it is desired to reduce the data size footprint. Keeping the versioning data around is incredibly handly for backwards compatibility.

Member Function Documentation

◆ ApplyLatestVersions()

void ScriptEventData::VersionedProperty::ApplyLatestVersions ( )
inline

Applies the latest version as the default, it can be used to make it easy to get access to the latest version.

◆ Flatten()

void ScriptEventData::VersionedProperty::Flatten ( )
inline

Applies the latest version as the default and clears the versioned information. Warning: This operation is intentionally destructive, if the asset is saved after flattening The versioning information will be lost, however, the asset size will be reduced.


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