Struct Manager
Defined in File sprite-mgr.h
Inheritance Relationships
Base Types
public CE::Assets::Cache::Store< CE::Assets::Sprites::Asset, std::string >(Template Struct Store)public CE::State::Singleton< Manager >(Template Class Singleton)
Struct Documentation
-
struct Manager : public CE::Assets::Cache::Store<CE::Assets::Sprites::Asset, std::string>, public CE::State::Singleton<Manager>
Declaration:
finalRetained namespace:name cache.
Load on the provider/loading owner after images; existing IDs stay unchanged and a batch failure can leave earlier entries. Inherited get_asset() returns a strong handle or null under the cache lock.
Public Functions
-
Manager() = default
Create an empty sprites cache sharing the active provider/loading-owner domain.
-
~Manager() override = default
Drop cache ownership; retained sprites values/frames keep their own resources.
-
Handle get_asset(std::string_view name_space, std::string_view name) const
Declaration:
[[nodiscard]]Look up one exact namespace/local-name pair without loading.
- Parameters:
name_space – Exact definition namespace, copied into the qualified lookup key.
name – Exact local asset name.
- Returns:
Strong retained handle, or null when absent; shared cache locking protects lookup and later clears do not invalidate the returned owner.
-
std::map<std::string, Handle, std::less<>> get_assets(std::string_view name_space) const
Declaration:
[[nodiscard]]Copy published sprites from one exact definition namespace under the cache read lock.
- Parameters:
name_space – Namespace matched against each retained definition.
- Returns:
Owned local-name map in lexical order, empty if absent; copied handles survive later clearing. No native work or loading occurs.
-
void load(const std::vector<Definition> &definitions, CE::Rendering::Resources::Provider &provider)
Build and publish absent qualified sprites IDs after their textures and explicit materials are loaded.
See also
- Parameters:
definitions – Stable CPU definitions with referenced grid/animation metadata.
provider – Active loading-owner backend/current context for geometry/default-material upload. Existing IDs retain their original handles without rebuilding. Explicit shader selections are retained; absent selections use the backend TexturedStrip default. Invalid definitions, missing image/materials, backend or allocation failures may leave earlier entries published. Reads retain immutable resources across cache clears.
-
inline virtual Handle get_asset(const std::string &key) const
Declaration:
[[nodiscard]]Copy an exact-key strong owner under a shared lock.
- Parameters:
key – Stable exact map key; base lookup performs no normalization, load or fallback.
- Returns:
Retained handle or null when missing, independent of later replacement/clear. Derived managers may define explicit alias policies; native use retains backend-domain limits.
-
Manager() = default