refs #781, use admit in database reader

* added amit functions in readers
* cacheHasChanged functions (needed because data of caches are loaded in background)
* pinned small caches
* CDatabaseReader::readInBackgroundThread uses admitCaches now
This commit is contained in:
Klaus Basan
2016-10-28 03:04:15 +02:00
parent f385e46d67
commit de7821ff86
13 changed files with 83 additions and 24 deletions

View File

@@ -42,8 +42,8 @@ namespace BlackCore
//! Trait for DB distributor cache
struct TDbDistributorCache : public BlackMisc::TDataTrait<BlackMisc::Simulation::CDistributorList>
{
//! Defer loading (no currently small)
static constexpr bool isDeferred() { return false; }
//! First load is synchronous, distributors is a small cache
static constexpr bool isPinned() { return true; }
//! Key in data cache
static const char *key() { return "dbdistributorcache"; }
@@ -83,8 +83,8 @@ namespace BlackCore
//! Trait for DB countries
struct TDbCountryCache : public BlackMisc::TDataTrait<BlackMisc::CCountryList>
{
//! Defer loading (no currently small)
static constexpr bool isDeferred() { return false; }
//! First load is synchronous, countries is a small cache
static constexpr bool isPinned() { return true; }
//! Key in data cache
static const char *key() { return "dbcountrycache"; }