Caches: method to query keys of all unsaved values.

This commit is contained in:
Mathew Sutcliffe
2016-06-08 21:39:12 +01:00
parent 183c4d9528
commit 000e22246f
2 changed files with 15 additions and 0 deletions

View File

@@ -201,6 +201,17 @@ namespace BlackMisc
return map;
}
QStringList CValueCache::getAllUnsavedKeys(const QString &keyPrefix) const
{
QMutexLocker lock(&m_mutex);
QStringList keys;
for (const auto &element : elementsStartingWith(keyPrefix))
{
if (element->m_value.isValid() && ! element->m_saved) { keys.push_back(element->m_key); }
}
return keys;
}
void CValueCache::insertValues(const CValueCachePacket &values)
{
QMutexLocker lock(&m_mutex);