|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Non-owning handle to an asset record managed by AssetManager. More...
#include <Asset.h>
Public Types | |
| using | RecordType = Record<Key, AssetClass> |
| using | Result = LoadResult<Key, AssetClass> |
Public Member Functions | |
| Ref ()=default | |
| 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. | |
| 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. | |
Private Member Functions | |
| Ref (std::shared_ptr< RecordType > record) | |
Static Private Member Functions | |
| static std::shared_future< Result > | expiredFuture () |
Private Attributes | |
| std::weak_ptr< RecordType > | record_ |
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.
| using Asset::Ref< Key, AssetClass >::RecordType = Record<Key, AssetClass> |
| using Asset::Ref< Key, AssetClass >::Result = LoadResult<Key, AssetClass> |
|
default |
|
inlineexplicitprivate |
|
inlinestaticprivate |
Definition at line 261 of file Asset.h.
Referenced by Asset::Ref< Asset::MeshPath, Animation >::readyFuture().
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
Gets the current loading state.
Definition at line 191 of file Asset.h.
Referenced by Asset::Ref< Asset::MeshPath, Animation >::isLoaded().
|
inlinenodiscard |
|
inlineexplicitnodiscard |
|
inlinenodiscard |
Gets a future for completion of the current generation.
|
private |