mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Caches: method to save values given a list of keys.
This commit is contained in:
@@ -158,6 +158,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
BlackMisc::CVariantMap getAllValues(const QString &keyPrefix = {}) const;
|
||||
|
||||
//! Return map containing all given values in the cache.
|
||||
//! \threadsafe
|
||||
BlackMisc::CVariantMap getAllValues(const QStringList &keys) const;
|
||||
|
||||
//! Return map containing all values in the cache, and timestamps when they were modified.
|
||||
//! \threadsafe
|
||||
BlackMisc::CValueCachePacket getAllValuesWithTimestamps(const QString &keyPrefix = {}) const;
|
||||
@@ -186,6 +190,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
CStatusMessage saveToFiles(const QString &directory, const QString &keyPrefix = {});
|
||||
|
||||
//! Save values to Json files in a given directory.
|
||||
//! \threadsafe
|
||||
CStatusMessage saveToFiles(const QString &directory, const QStringList &keys);
|
||||
|
||||
//! Load all values from Json files in a given directory.
|
||||
//! Values already in the cache will remain in the cache unless they are overwritten.
|
||||
//! \threadsafe
|
||||
@@ -256,6 +264,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
void markAllAsSaved(const QString &keyPrefix);
|
||||
|
||||
//! Mark all values with given keys as having been saved.
|
||||
//! \threadsafe
|
||||
void markAllAsSaved(const QStringList &keys);
|
||||
|
||||
//! Mutex protecting operations which are critical on m_elements.
|
||||
mutable QMutex m_mutex { QMutex::Recursive };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user