Caches: rename "get" to "getThreadLocal" and rename "getCopy" to get.

This commit is contained in:
Mathew Sutcliffe
2016-06-06 15:47:11 +01:00
committed by Klaus Basan
parent 332d8e5fc8
commit 9bef6854ca
30 changed files with 83 additions and 83 deletions

View File

@@ -333,11 +333,11 @@ namespace BlackMisc
{}
//! Read the current value.
const T &get() const { static const T empty {}; return *(isValid() ? static_cast<const T *>(getVariant().data()) : &empty); }
const T &getThreadLocal() const { static const T empty {}; return *(isValid() ? static_cast<const T *>(getVariant().data()) : &empty); }
//! Get a copy of the current value.
//! \threadsafe
T getCopy() const { return isValid() ? getVariantCopy().template value<T>() : T{}; }
T get() const { return isValid() ? getVariantCopy().template value<T>() : T{}; }
//! Write a new value. Must be called from the thread in which the owner lives.
CStatusMessage set(const T &value, qint64 timestamp = 0) { return m_page.setValue(m_element, CVariant::from(value), timestamp); }