mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #659 Read-only versions of cache value access classes.
This commit is contained in:
@@ -356,6 +356,26 @@ namespace BlackMisc
|
||||
CStatusMessage save() = delete;
|
||||
};
|
||||
|
||||
/*!
|
||||
* Class template for read-only access to a specific value in the CDataCache.
|
||||
* \tparam Trait A subclass of BlackMisc::CDataTrait that identifies the value's key and other metadata.
|
||||
*/
|
||||
template <typename Trait>
|
||||
class CDataReadOnly : public BlackMisc::CData<Trait>
|
||||
{
|
||||
public:
|
||||
//! Inherited constructor.
|
||||
using CData<Trait>::CData;
|
||||
|
||||
//! Deleted mutators.
|
||||
//! @{
|
||||
CStatusMessage set(const typename Trait::type &value, qint64 timestamp = 0) = delete;
|
||||
CStatusMessage setProperty(const CPropertyIndex &index, const CVariant &value, qint64 timestamp = 0) = delete;
|
||||
CStatusMessage setDefault() = delete;
|
||||
void renewTimestamp(qint64 timestamp) = delete;
|
||||
//! @}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Base class for traits to be used as template argument to BlackMisc::CData.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user