|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Internal storage for one asset entry managed by AssetManager. More...
#include <Asset.h>
Public Types | |
| using | Result = LoadResult<Key, AssetClass> |
Public Member Functions | |
| Record (Key key) | |
| Creates an unloaded record for an asset key. | |
| void | resetFuture () |
| Starts a new ready future for the current generation. | |
Public Attributes | |
| Key | key |
| Asset lookup key for this record. | |
| std::unique_ptr< AssetClass > | asset |
| Owned payload instance, or nullptr while no payload is available. | |
| LoadState | state = UNLOADED |
| Current CPU loading state for the record. | |
| uint64_t | generation = 0 |
| Monotonic version incremented when the payload lifecycle restarts. | |
| std::string | lastError |
| Last failure message reported for this record. | |
| std::shared_ptr< std::promise< Result > > | readyPromise |
| Promise used by AssetManager to complete readyFuture. | |
| std::shared_future< Result > | readyFuture |
| Shared future resolved when the current generation succeeds or fails. | |
| bool | readyPromiseResolved = false |
| True after readyPromise has been resolved for the current generation. | |
Internal storage for one asset entry managed by AssetManager.
A record keeps the stable identity of an asset key while the payload changes over time. Asset::Ref instances hold weak references to records so they stay valid across payload replacement and unload operations until the manager clears the record itself.
| using Asset::Record< Key, AssetClass >::Result = LoadResult<Key, AssetClass> |
|
inlineexplicit |
Creates an unloaded record for an asset key.
| key | Asset key stored by this record. |
Definition at line 112 of file Asset.h.
References key, and resetFuture().
|
inline |
Starts a new ready future for the current generation.
Definition at line 120 of file Asset.h.
References readyFuture, readyPromise, and readyPromiseResolved.
Referenced by Record().
| std::unique_ptr<AssetClass> Asset::Record< Key, AssetClass >::asset |
| uint64_t Asset::Record< Key, AssetClass >::generation = 0 |
| Key Asset::Record< Key, AssetClass >::key |
| std::string Asset::Record< Key, AssetClass >::lastError |
| std::shared_future<Result> Asset::Record< Key, AssetClass >::readyFuture |
Shared future resolved when the current generation succeeds or fails.
Definition at line 160 of file Asset.h.
Referenced by resetFuture().
| std::shared_ptr<std::promise<Result> > Asset::Record< Key, AssetClass >::readyPromise |
Promise used by AssetManager to complete readyFuture.
Definition at line 155 of file Asset.h.
Referenced by resetFuture().
| bool Asset::Record< Key, AssetClass >::readyPromiseResolved = false |
True after readyPromise has been resolved for the current generation.
Definition at line 165 of file Asset.h.
Referenced by resetFuture().
| LoadState Asset::Record< Key, AssetClass >::state = UNLOADED |