template<typename T, typename ... KeyArgs> asge::game::asset::AssetPool
A VFS-backed, path-keyed cache of shared_ptr<Asset<T>>, loaded via a caller-supplied Loader on first request.
#include <AssetPool.hpp>KeyArgs extends the cache key past the virtual path for asset types a bare path doesn't fully identify — e.g. a font's bake pixel height, so "fonts/x.ttf" at two different sizes gets two independent cache entries (see AssetManager's AssetPool<graphics::Font, int>). The key is the exact virtual-path string plus KeyArgs as passed to GetOrLoad — it is not canonicalized, so two differently-formatted but VFS-equivalent virtual paths (e.g. a leading /) are cached separately.
Public Types
using Loader = std::function< Result< T >(filesystem::Path const &, KeyArgs...)>Loads T from a resolved real path plus this pool's extra key args.
Private Types
Private Attributes
Public Member Functions
explicit AssetPool(Loader inLoader) noexceptAssetPool(AssetPool const &)=deleteAssetPool(AssetPool &&)=defaultResult< asset_ptr > GetOrLoad(filesystem::VirtualFileSystem const &inVfs, str::StringCRef inVirtualPath, KeyArgs ...inArgs) noexceptReturns the cached asset for this virtual path/key, loading it through the VFS and Loader on a cache miss.
A VFS resolve failure or a Loader failure is returned as-is and nothing is cached for that key, so a later call retries the load.