refs #601 Fixed thread safety of get() by adding getCopy().

This commit is contained in:
Mathew Sutcliffe
2016-03-10 23:30:34 +00:00
parent 3e21b718d9
commit a47a2681bd
3 changed files with 27 additions and 3 deletions

View File

@@ -57,9 +57,16 @@ namespace BlackMisc
//! \param slot Optional member function of parent, will be called when value changes.
Element &createElement(const QString &key, int metaType, Validator validator, const CVariant &defaultValue, NotifySlot slot);
//! True if the currently paged value is a valid instance of the given type.
//! \threadsafe
bool isValid(const Element &element, int typeId) const;
//! Read the currently paged value corresponding to the element's key.
const CVariant &getValue(const Element &element) const;
//! Read the currently paged value corresponding to the element's key.
//! \threadsafe
const CVariant &getValue(const Element &element) const;
CVariant getValueCopy(const Element &element) const;
//! Write the value corresponding to the element's key and begin synchronizing it to any other pages.
CStatusMessage setValue(Element &element, const CVariant &value, qint64 timestamp, bool save = false);