#include <InstanceId.h>
Public Types | |
| using | SubIdContainer = AZStd::fixed_vector< uint32_t, SubIdCapacity > |
Public Member Functions | |
| AZ_TYPE_INFO (InstanceId, "{0E59A635-07E8-419F-A0F2-90E0CE9C0AD6}") | |
| 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 |
| const Uuid & | GetGuid () const |
Static Public Member Functions | |
| static InstanceId | CreateFromAsset (const Asset< AssetData > &asset, const SubIdContainer &subIds={}) |
| static InstanceId | CreateFromAssetId (const AssetId &assetId, const SubIdContainer &subIds={}) |
| static InstanceId | CreateName (const char *name, const SubIdContainer &subIds={}) |
| static InstanceId | CreateData (const void *data, size_t dataSize, const SubIdContainer &subIds={}) |
| static InstanceId | CreateUuid (const AZ::Uuid &guid, const SubIdContainer &subIds={}) |
| static InstanceId | CreateRandom () |
Static Public Attributes | |
| static constexpr const int | SubIdCapacity = 4 |
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.
|
static |
Creates an InstanceId with a GUID constructed from the data buffer. Additional sub IDs can be provided by the system creating the instances.
|
static |
Creates an instance id from an asset. The GUID will be copied from the asset id. The first sub id will be the asset id sub id. The second sub id will be the asset creation token, or AZ::Data::s_defaultCreationToken if it is not available. Any additional sub IDs will be added after that.
|
static |
Creates an instance id from an asset id. The GUID will be copied from the asset id. The first sub id will be the asset id sub id. The second sub id will be AZ::Data::s_defaultCreationToken so that it is uniform with CreateFromAsset. Any additional sub IDs will be added after that.
|
static |
Creates an InstanceId with a GUID constructed from the name string. Additional sub IDs can be provided by the system creating the instances.
|
static |
Creates a random InstanceId.
|
static |
Creates an InstanceId with a GUID constructed from the UUID. Additional sub IDs can be provided by the system creating the instances.
|
staticconstexpr |
Support assigning multiple sub IDs for additional uniqueness between instances. For asset related instances, the first two sub IDs are reserved for the asset id sub id and the creation token, if available. Otherwise, any unreserved or unused sub IDs can be assigned according to the needs of the system managing instances.