mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T182, added coverageSummary / count functions
This commit is contained in:
@@ -183,6 +183,17 @@ namespace BlackMisc
|
||||
return objs.oldestDbTimestamp();
|
||||
}
|
||||
|
||||
template<class OBJ, class CONTAINER, typename KEYTYPE>
|
||||
int IDatastoreObjectList<OBJ, CONTAINER, KEYTYPE>::countWithValidDbKey() const
|
||||
{
|
||||
int count = 0;
|
||||
for (const OBJ &obj : ITimestampObjectList<OBJ, CONTAINER>::container())
|
||||
{
|
||||
if (obj.hasValidDbKey()) { count++; }
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
template<class OBJ, class CONTAINER, typename KEYTYPE>
|
||||
QDateTime IDatastoreObjectList<OBJ, CONTAINER, KEYTYPE>::latestDbTimestamp() const
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BlackMisc
|
||||
//! All keys as set
|
||||
QSet<KEYTYPE> toDbKeySet() const;
|
||||
|
||||
//! All keys as string set (also int keys will be converted to string)
|
||||
//! All keys as string set (also integer keys will be converted to string)
|
||||
QSet<QString> toDbKeyStringSet() const;
|
||||
|
||||
//! The DB keys as string
|
||||
@@ -62,6 +62,9 @@ namespace BlackMisc
|
||||
//! Latest DB timestamp (means objects with DB key)
|
||||
QDateTime oldestDbTimestamp() const;
|
||||
|
||||
//! Number of entries with valid DB key
|
||||
int countWithValidDbKey() const;
|
||||
|
||||
//! From DB JSON with default prefixes
|
||||
//! \remark Specialized classes might have their own fromDatabaseJson implementation
|
||||
static CONTAINER fromDatabaseJson(const QJsonArray &array);
|
||||
|
||||
Reference in New Issue
Block a user