Struct Manager

Inheritance Relationships

Base Types

Struct Documentation

struct Manager : public CE::Assets::Cache::Store<CE::Rendering::Resources::Image>, public CE::State::Singleton<Manager>

Declaration: final

Image cache with exact normalized-path lookup and optional unambiguous basename fallback.

Publication is serialized on the global provider/loading owner; reads copy retained handles under the cache lock. Existing image contents are immutable.

Public Functions

Manager() = default

Create an empty image cache sharing the supported provider/loading-owner policy.

~Manager() override = default

Drop image-cache strong handles; external readers/frames keep independent image ownership.

virtual Handle get_asset(const std::filesystem::path &file) const override

Declaration: [[nodiscard]]

Look up a lexically normalized exact path first, then a bare filename only if unique.

Parameters:

file – Exact path, or basename without parent components for convenience fallback.

Returns:

Retained immutable image or null if absent. Multiple basename matches throw runtime_exception. Lookup is synchronized; inherited contains() remains exact-key-only. Relative paths are not made absolute by this method.

void load(const std::vector<std::filesystem::path> &files, CE::Rendering::Resources::Provider &provider)

Decode/upload absent normalized keys on the active provider loading owner/current context.

Parameters:
  • files – Paths borrowed through synchronous load; relative paths follow provider file I/O working-directory rules.

  • provider – Single active backend domain. Existing entries skip file reads/upload. Decode/backend/allocation failure can leave earlier entries published; no batch replacement or rollback occurs.

void upload(const std::filesystem::path &file, const Decoded &image, CE::Rendering::Resources::Provider &provider)

Publish an absent normalized image key from already decoded CPU pixels.

See also

Staged loading

Parameters:
  • file – Intended exact path key, lexically normalized without reopening it.

  • image – Pixels borrowed through create_image(); caller retains/reuses them after return.

  • provider – Active backend loading owner/current context. Existing keys skip upload. Invalid/native/allocation failure publishes no candidate for this key; earlier cache entries remain.