#include <InstanceData.h>
Public Member Functions | |
AZ_RTTI (InstanceData, "{3B728818-A765-4749-A3A6-0C960E4DD65E}") | |
const InstanceId & | GetId () const |
const AssetId & | GetAssetId () const |
const AssetType & | GetAssetType () const |
Friends | |
template<typename Type > | |
struct | AZStd::IntrusivePtrCountPolicy |
template<typename Type > | |
class | InstanceDatabase |
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.
const AssetId & AZ::Data::InstanceData::GetAssetId | ( | ) | const |
Returns the asset id used to create the instance.
const AssetType & AZ::Data::InstanceData::GetAssetType | ( | ) | const |
Returns the asset type used to create the instance.
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.