Open 3D Engine AtomCore 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::Data::InstanceId Struct Reference

#include <InstanceId.h>

Public Member Functions

 AZ_TYPE_INFO (InstanceId, "{0E59A635-07E8-419F-A0F2-90E0CE9C0AD6}")
 
 InstanceId (const Uuid &guid)
 
 InstanceId (const Uuid &guid, uint32_t subId)
 
 InstanceId (const Uuid &guid, uint32_t subId, void *versionId)
 
bool IsValid () const
 
bool operator< (const InstanceId &rhs) const
 
bool operator== (const InstanceId &rhs) const
 
bool operator!= (const InstanceId &rhs) const
 
template<class StringType >
StringType ToString () const
 
template<class StringType >
void ToString (StringType &result) const
 

Static Public Member Functions

static InstanceId CreateFromAsset (const Asset< AssetData > &asset)
 
static InstanceId CreateFromAssetId (const AssetId &assetId)
 
static InstanceId CreateName (const char *name)
 
static InstanceId CreateData (const void *data, size_t dataSize)
 
static InstanceId CreateRandom ()
 

Public Attributes

Uuid m_guid = Uuid::CreateNull()
 
uint32_t m_subId = 0
 
void * m_versionId = nullptr
 

Detailed Description

InstanceId is a unique identifier for an Instance in an InstanceDatabase. Instances are used primarily to control de-duplication of 'instances' created from 'assets'. As a result, this class mirrors the structure of asset id (by including the sub-id) in order to make translation easy. However, the types are not related in order to add some type safety to the system.

Member Function Documentation

◆ CreateData()

static InstanceId AZ::Data::InstanceId::CreateData ( const void *  data,
size_t  dataSize 
)
static

Creates an InstanceId by hashing the provided data.

◆ CreateFromAsset()

static InstanceId AZ::Data::InstanceId::CreateFromAsset ( const Asset< AssetData > &  asset)
static

Creates an instance id from an asset. The instance id will share the same guid, sub id, and an opaque pointer value to identify a specific version of an asset. This is a create method rather than a constructor in order to make it explicit.

◆ CreateFromAssetId()

static InstanceId AZ::Data::InstanceId::CreateFromAssetId ( const AssetId &  assetId)
static

Creates an instance id from an asset id. The two will share the same guid and sub id. This is a create method rather than a constructor in order to make it explicit.

◆ CreateName()

static InstanceId AZ::Data::InstanceId::CreateName ( const char *  name)
static

Creates an InstanceId by hashing the provided name.

◆ CreateRandom()

static InstanceId AZ::Data::InstanceId::CreateRandom ( )
static

Creates a random InstanceId.


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