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::InstanceData Class Reference

#include <InstanceData.h>

Public Member Functions

 AZ_RTTI (InstanceData, "{3B728818-A765-4749-A3A6-0C960E4DD65E}")
 
const InstanceIdGetId () const
 
const AssetId & GetAssetId () const
 
const AssetType & GetAssetType () const
 

Friends

template<typename Type >
struct AZStd::IntrusivePtrCountPolicy
 
template<typename Type >
class InstanceDatabase
 

Detailed Description

InstanceData is an intrusive smart pointer base class for any class utilizing an InstanceDatabase. To use a class in an InstanceDatabase, you must inherit from InstanceData, and in your concrete class, define the AZ_INSTANCE_DATA() macro.

InstanceData is compatible with AZStd::intrusive_ptr. The pointer is also typedef'd to AZ::Data::Instance<> to mirror AZ::Data::Asset<>.

Each instance data is associated with an instance id and an asset id. These id's are only valid if the instance is created from an InstanceDatabase, otherwise they are null. It is valid to create a derived instance data class without using the InstanceDatabase, but the ids will all be null.

By default, if the instance database did not create the instance, InstanceData will call 'delete' on itself when the reference count hits zero. If the instance database was the creator, it will assign a custom deleter. You do not have access to this deleter.

Member Function Documentation

◆ GetAssetId()

const AssetId & AZ::Data::InstanceData::GetAssetId ( ) const

Returns the asset id used to create the instance.

◆ GetAssetType()

const AssetType & AZ::Data::InstanceData::GetAssetType ( ) const

Returns the asset type used to create the instance.

◆ GetId()

const InstanceId & AZ::Data::InstanceData::GetId ( ) const

Returns the id which uniquely identifies the instance in the instance database. If the concrete class was created outside of the database, the id is null.


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