Template Struct Store
Defined in File asset-mgr.h
Inheritance Relationships
Base Type
public CE::Assets::Cache::Context(Class Context)
Struct Documentation
-
template<typename AssetType, typename Key = std::filesystem::path, typename Allocator = std::allocator<std::pair<const Key, std::shared_ptr<AssetType>>>>
struct Store : public CE::Assets::Cache::Context Caches constructed assets by key.
reserve() provides storage whose slots callers construct selectively with emplace(); the older allocate() interface returns unconstructed handles for manual construction. Publish complete assets under a unique lock; readers copy retained handles under a shared lock. Construction and final release happen outside the lock.
Public Functions
-
Store() = default
-
inline virtual ~Store()
-
inline std::size_t size() const
Declaration:
[[nodiscard]]
-
inline virtual void clear_assets() noexcept
Protected Functions
-
template<typename Published>
inline Handle publish_asset(const Key &key, Handle asset, Published &&published)
-
template<typename Derived>
inline auto reserve(const std::size_t N) Reserve raw slots for selective construction with emplace().
Provide raw object handles for callers that construct slots manually.
Protected Attributes
-
mutable std::shared_mutex assets_mutex_
-
const CE::Diagnostics::DomainId domain_ = CE::Diagnostics::next_domain_id()
-
std::uint64_t publications_ = 0
-
std::uint64_t replacements_ = 0
-
Store() = default