mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #581 Allow setting the timestamp when putting a value in the cache.
This commit is contained in:
@@ -279,10 +279,10 @@ namespace BlackMisc
|
||||
const T &get() const { static const T empty {}; return *(isValid() ? static_cast<const T *>(getVariant().data()) : &empty); }
|
||||
|
||||
//! Write a new value. Must be called from the thread in which the owner lives.
|
||||
CStatusMessage set(const T &value) { return m_page.setValue(m_element, CVariant::from(value)); }
|
||||
CStatusMessage set(const T &value, qint64 timestamp = 0) { return m_page.setValue(m_element, CVariant::from(value), timestamp); }
|
||||
|
||||
//! Write and save in the same step. Must be called from the thread in which the owner lives.
|
||||
CStatusMessage setAndSave(const T &value) { return m_page.setValue(m_element, CVariant::from(value), true); }
|
||||
CStatusMessage setAndSave(const T &value, qint64 timestamp = 0) { return m_page.setValue(m_element, CVariant::from(value), timestamp, true); }
|
||||
|
||||
//! Get the key string of this value.
|
||||
const QString &getKey() const { return m_page.getKey(m_element); }
|
||||
|
||||
Reference in New Issue
Block a user