|
| | Ref ()=default |
| | Creates an empty ref that points to no record.
|
| LoadState | getState () const |
| | Gets the current loading state.
|
| bool | isLoaded () const |
| | Checks whether the referenced asset has a loaded payload.
|
| AssetClass * | get () const |
| | Gets the loaded payload.
|
| std::shared_ptr< RecordType > | sharedRecord () const |
| | Gets a shared handle to the underlying record, keeping it (and its asset payload) alive as long as any returned shared_ptr is held.
|
| uint64_t | getGeneration () const |
| | Gets the current record generation.
|
| const std::string & | getError () const |
| | Gets the last load error reported by the record.
|
| std::shared_future< Result > | readyFuture () const |
| | Gets a future for completion of the current generation.
|
| | operator bool () const |
| | Checks whether this ref still points to a live record.
|
template<typename Key, typename AssetClass>
class Asset::Ref< Key, AssetClass >
Non-owning handle to an asset record managed by AssetManager.
Ref keeps access to an asset's state, payload pointer, completion future, generation, and error string without owning the underlying record. A default-constructed ref or a ref whose manager record has been erased evaluates to false.
- Template Parameters
-
| Key | Asset lookup key type. |
| AssetClass | Asset payload type. |
Definition at line 179 of file Asset.h.
template<typename Key, typename AssetClass>
Gets a shared handle to the underlying record, keeping it (and its asset payload) alive as long as any returned shared_ptr is held.
Used to pin asset-owned data (e.g. unpacked mesh vertices) for asynchronous uploads: a consumer can alias this record's lifetime without owning a copy of the data.
Definition at line 226 of file Asset.h.