refs #494 Value class CValueCachePacket is a packet of cache value changes with timestamps.

This commit is contained in:
Mathew Sutcliffe
2015-10-22 22:25:34 +01:00
parent a284de3acb
commit eb11b69c6d
6 changed files with 142 additions and 0 deletions

View File

@@ -89,6 +89,24 @@ const &operator>>(const QJsonValueRef &json, ENUM &value)
return json;
}
//! \brief Specialized JSON deserialization for pair
//! \ingroup JSON
template<class FIRST, class SECOND>
const QJsonValueRef &operator>>(const QJsonValueRef &json, std::pair<FIRST, SECOND> &pair)
{
json.toArray() >> pair.first >> pair.second;
return json;
}
//! \brief Specialized JSON serialization for pair
//! \ingroup JSON
template<class FIRST, class SECOND>
QJsonArray &operator<<(QJsonArray &json, const std::pair<FIRST, SECOND> &pair)
{
QJsonArray array;
return json << QJsonValue(array << pair.first << pair.second);
}
//! \name Streaming operators for QJsonArray (from value)
//! \ingroup JSON
//! @{