mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 10:57:01 +08:00
refs #460 CDataCache for dynamic (downloaded/generated) data with file-based distribution among processes.
This commit is contained in:
@@ -91,13 +91,22 @@ namespace BlackMisc
|
||||
//! of CValueCache instances in all processes including this one. The slot will do its own round-trip detection.
|
||||
void valuesChangedByLocal(const BlackMisc::CVariantMap &values);
|
||||
|
||||
protected:
|
||||
//! Save specific values to Json files in a given directory.
|
||||
CStatusMessage saveToFiles(const QString &directory, const CVariantMap &values) const;
|
||||
|
||||
//! Load from Json files in a given directory any values which differ from the current ones, and insert them in o_values.
|
||||
CStatusMessage loadFromFiles(const QString &directory, CVariantMap &o_values) const;
|
||||
|
||||
//! Mutex protecting operations which are critical on m_elements.
|
||||
mutable QMutex m_mutex { QMutex::Recursive };
|
||||
|
||||
private:
|
||||
friend class Private::CValuePage;
|
||||
struct Element;
|
||||
using ElementPtr = QSharedPointer<Element>; // QMap doesn't support move-only types
|
||||
|
||||
QMap<QString, ElementPtr> m_elements;
|
||||
mutable QMutex m_mutex { QMutex::Recursive };
|
||||
|
||||
Element &getElement(const QString &key);
|
||||
Element &getElement(const QString &key, QMap<QString, ElementPtr>::const_iterator pos);
|
||||
|
||||
Reference in New Issue
Block a user