|
template<typename U > |
| CCached (CValueCache *cache, const QString &key, const QString &name, U *owner) |
| Constructor. More...
|
|
template<typename U , typename F > |
| CCached (CValueCache *cache, const QString &key, const QString &name, F validator, const T &defaultValue, U *owner) |
| Constructor. More...
|
|
template<typename F > |
void | setNotifySlot (F slot) |
| Set a callback to be called when the value is changed by another source.
|
|
const T & | getThreadLocal () const |
| Read the current value.
|
|
T | get () const |
| Get a copy of the current value. More...
|
|
CStatusMessage | set (const T &value, qint64 timestamp=0) |
| Write a new value. Must be called from the thread in which the owner lives.
|
|
CStatusMessage | setAndSave (const T &value, qint64 timestamp=0) |
| Write and save in the same step. Must be called from the thread in which the owner lives.
|
|
CStatusMessage | save () |
| Save using the currently set value. Must be called from the thread in which the owner lives.
|
|
CStatusMessage | setProperty (CPropertyIndexRef index, const CVariant &value, qint64 timestamp=0) |
| Write a property of the value. Must be called from the thread in which the owner lives.
|
|
CStatusMessage | setAndSaveProperty (CPropertyIndexRef index, const CVariant &value, qint64 timestamp=0) |
| Write a property and save in the same step. Must be called from the thread in which the owner lives.
|
|
bool | isOwnerThread () const |
| Is current thread the owner thread, so CCached::set is safe.
|
|
const QString & | getKey () const |
| Get the key string of this value.
|
|
QDateTime | getTimestamp () const |
| Return the time when this value was updated. More...
|
|
qint64 | getTimestampMsSinceEpoch () const |
| Return the time when this value was updated. More...
|
|
qint64 | lastUpdatedAge () const |
| How old is that cache (ms)?
|
|
bool | isSaved () const |
| Return true if this value was already saved.
|
|
bool | isSaving () const |
| Return true if this value is currently saving.
|
|
bool | isInitialized () const |
| Can be false if key contains OwnerName% and owner's objectName was empty.
|
|
| CCached (const CCached &)=delete |
| Deleted copy constructor.
|
|
CCached & | operator= (const CCached &)=delete |
| Deleted copy assignment operator.
|
|
template<typename T>
class swift::misc::CCached< T >
Provides access to one of the values stored in a CValueCache.
- Template Parameters
-
T | The expected value type of the cached value. |
Definition at line 352 of file valuecache.h.