HDK
|
Scoped accessor object for accessing unified cache items. More...
#include <UT_ThreadSafeCache.h>
Public Member Functions | |
UT_UnifiedCacheAccessor (T *item=0, void *parm=0) | |
~UT_UnifiedCacheAccessor () | |
Release the currently accessed cache item, if any. More... | |
bool | empty () const |
Returns true if no item is being accessed. More... | |
T * | item () const |
Returns the current item being accessed. More... | |
T * | operator-> () const |
void | reset (T *item, void *parm=0) |
Scoped accessor object for accessing unified cache items.
Definition at line 420 of file UT_ThreadSafeCache.h.
|
inline |
Default initializer. Can be used to initialize the accessor to a cache item right away. Otherwise call reset
to set the item to access.
Definition at line 425 of file UT_ThreadSafeCache.h.
|
inline |
Release the currently accessed cache item, if any.
Definition at line 431 of file UT_ThreadSafeCache.h.
|
inline |
Returns true
if no item is being accessed.
Definition at line 437 of file UT_ThreadSafeCache.h.
|
inline |
Returns the current item being accessed.
Definition at line 440 of file UT_ThreadSafeCache.h.
|
inline |
Indirection operator for the current item being accessed. It is the caller's responsibility to ensure that the item is valid, e.g. by calling empty
on it first.
Definition at line 445 of file UT_ThreadSafeCache.h.
Reset the currently accessed cached item to a new item. If the item given is the same as the one currently being accessed, this call is a no-op, even if a new param
value is given. Reset the item to nullptr
and back to the wanted item if a change in parm
value is required.
Definition at line 452 of file UT_ThreadSafeCache.h.