Rebel Fork Framework
|
#include <Urho3D/Core/ThreadSafeCache.h>
Public Member Functions | |
void | Invalidate () |
Invalidate cached object. | |
bool | IsInvalidated () const |
Return whether the object is invalid and has to be restored. | |
void | Restore (const T &object) |
Restore cached object. This call may be ignored if cache is already restored. | |
ThreadSafeCache< T > & | operator= (const T &object) |
Same as Restore. | |
const T & | Get () const |
Return object value. Intentionally unchecked, caller must ensure that cache is valid. | |
Private Attributes | |
std::atomic_bool | dirty_ = true |
Whether dirty flag is set. | |
SpinLockMutex | mutex_ |
Spinlock mutex for updating cached object. | |
T | object_ {} |
Cached object. | |
Thread-safe cache that holds an object. It's safe to: