refs #581 Allow setting the timestamp when putting a value in the cache.

This commit is contained in:
Mathew Sutcliffe
2016-02-02 22:51:08 +00:00
parent 97fad301ae
commit e1b40f54cb
4 changed files with 8 additions and 7 deletions

View File

@@ -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); }