ARB
|
Handle for Cache entries. More...
#include <cache.h>
Public Member Functions | |
CacheHandle () | |
~CacheHandle () | |
void | assign (SMARTPTR data, Cache< SMARTPTR > &cache) |
SMARTPTR | access (Cache< SMARTPTR > &cache) |
void | release (Cache< SMARTPTR > &cache) |
bool | is_cached () const |
Handle for Cache entries.
|
inline |
create a new, unbound CacheHandle
Each (potential) cache entry needs a CacheHandle on client side.
|
inline |
destroys a CacheHandle
Before destrying it, you need to either call release() or Cache::flush().
|
inline |
assign data to a CacheHandle
data | SmartPtr containing client data (may not be NULp) |
cache | Cache in which data shall be stored |
The assigned data is stored in the Cache.
When the cache is filled, calls to assign() will invalidate other cache entries and their CacheHandles.
Definition at line 251 of file cache.h.
Referenced by probe_input_data::get_dataPtr(), and probe_input_data::preload_rel2abs().
|
inline |
read data from cache
cache | Cache to which data has been assigned earlier |
You need to check whether the assigned data still is cached by calling is_cached() before you can use this function. e.g. like follows
The data behind the returned smartptr will stay valid until its destruction, even if the handle is invalidated by other code.
Calling access() will also make this CacheHandle the "newest" handle in cache, i.e. the one with the longest lifetime.
Definition at line 275 of file cache.h.
Referenced by probe_input_data::calc_relpos(), probe_input_data::get_abspos(), and probe_input_data::get_dataPtr().
|
inline |
actively release data from cache
cache | Cache to which data has been assigned earlier |
Call this either
Definition at line 288 of file cache.h.
Referenced by probe_input_data::~probe_input_data().
|
inline |
check status of CacheHandle
Definition at line 298 of file cache.h.
Referenced by cache::CacheHandle< SmartCharPtr >::assign(), probe_input_data::get_abspos(), probe_input_data::get_dataPtr(), probe_input_data::preload_rel2abs(), cache::CacheHandle< SmartCharPtr >::release(), and cache::CacheHandle< SmartCharPtr >::~CacheHandle().