Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::basic_storage Struct Referenceabstract

Abstract base class for asset storage. More...

#include <asset_storage.h>

Inheritance diagram for unravel::basic_storage:
unravel::asset_storage< T >

Public Member Functions

virtual ~basic_storage ()=default
 
virtual void unload_all (tpp::thread_pool &pool)=0
 Unloads all assets.
 
virtual void unload_single (tpp::thread_pool &pool, const std::string &key)=0
 Unloads a single asset by its key.
 
virtual void unload_group (tpp::thread_pool &pool, const std::string &group)=0
 Unloads all assets in a specified group.
 
virtual void evict_unused (tpp::thread_pool &pool, const std::string &group, std::chrono::steady_clock::duration max_idle)=0
 Evicts loaded assets not accessed within the given duration. Demotes them back to deferred state so memory is freed.
 
virtual void preload_all ()=0
 Triggers loading on all deferred handles in this storage. Non-blocking: starts background loads but does not wait.
 

Detailed Description

Abstract base class for asset storage.

Definition at line 427 of file asset_storage.h.

Constructor & Destructor Documentation

◆ ~basic_storage()

virtual unravel::basic_storage::~basic_storage ( )
virtualdefault

Member Function Documentation

◆ evict_unused()

virtual void unravel::basic_storage::evict_unused ( tpp::thread_pool & pool,
const std::string & group,
std::chrono::steady_clock::duration max_idle )
pure virtual

Evicts loaded assets not accessed within the given duration. Demotes them back to deferred state so memory is freed.

Parameters
poolThe thread pool.
max_idleMaximum idle duration before eviction.

Implemented in unravel::asset_storage< T >.

◆ preload_all()

virtual void unravel::basic_storage::preload_all ( )
pure virtual

Triggers loading on all deferred handles in this storage. Non-blocking: starts background loads but does not wait.

Implemented in unravel::asset_storage< T >.

◆ unload_all()

virtual void unravel::basic_storage::unload_all ( tpp::thread_pool & pool)
pure virtual

Unloads all assets.

Parameters
poolThe thread pool for unloading tasks.

Implemented in unravel::asset_storage< T >.

◆ unload_group()

virtual void unravel::basic_storage::unload_group ( tpp::thread_pool & pool,
const std::string & group )
pure virtual

Unloads all assets in a specified group.

Parameters
poolThe thread pool for unloading tasks.
groupThe group to unload.

Implemented in unravel::asset_storage< T >.

◆ unload_single()

virtual void unravel::basic_storage::unload_single ( tpp::thread_pool & pool,
const std::string & key )
pure virtual

Unloads a single asset by its key.

Parameters
poolThe thread pool for unloading tasks.
keyThe key of the asset to unload.

Implemented in unravel::asset_storage< T >.


The documentation for this struct was generated from the following file: