mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #649, add.function getSyncronizedValues
Normally getValue should transparently sync. But this force me to make the function non-const.
This commit is contained in:
@@ -26,6 +26,13 @@ namespace BlackMisc
|
||||
this->setCachedModels(models, simulator);
|
||||
}
|
||||
|
||||
CAircraftModelList IMultiSimulatorModelCaches::getSyncronizedCachedModels(const CSimulatorInfo &simulator)
|
||||
{
|
||||
BLACK_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator");
|
||||
this->syncronizeCache(simulator);
|
||||
return this->getCachedModels(simulator);
|
||||
}
|
||||
|
||||
CAircraftModelList IMultiSimulatorModelCaches::getCurrentCachedModels() const
|
||||
{
|
||||
const CSimulatorInfo sim(this->getCurrentSimulator());
|
||||
@@ -34,6 +41,13 @@ namespace BlackMisc
|
||||
return this->getCachedModels(sim);
|
||||
}
|
||||
|
||||
QDateTime IMultiSimulatorModelCaches::getSyncronizedTimestamp(const CSimulatorInfo &simulator)
|
||||
{
|
||||
BLACK_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator");
|
||||
this->syncronizeCache(simulator);
|
||||
return this->getCacheTimestamp(simulator);
|
||||
}
|
||||
|
||||
bool IMultiSimulatorModelCaches::syncronizeCurrentCache()
|
||||
{
|
||||
const CSimulatorInfo sim(this->getCurrentSimulator());
|
||||
|
||||
@@ -162,6 +162,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
virtual CAircraftModelList getCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator) const = 0;
|
||||
|
||||
//! Models
|
||||
//! \todo is that threadsafe?
|
||||
CAircraftModelList getSyncronizedCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Models
|
||||
//! \threadsafe
|
||||
CAircraftModelList getCurrentCachedModels() const;
|
||||
@@ -170,13 +174,19 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
virtual QDateTime getCacheTimestamp(const BlackMisc::Simulation::CSimulatorInfo &simulator) const = 0;
|
||||
|
||||
//! Timestamp
|
||||
//! \todo is that threadsafe?
|
||||
QDateTime getSyncronizedTimestamp(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Last selection`s timestamp
|
||||
//! \threadsafe
|
||||
QDateTime getCurrentCacheTimestamp() const;
|
||||
|
||||
//! Set cache
|
||||
virtual BlackMisc::CStatusMessage setCachedModels(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulator) = 0;
|
||||
|
||||
//! Syncronize
|
||||
//! \todo is that threadsafe?
|
||||
virtual void syncronizeCache(const BlackMisc::Simulation::CSimulatorInfo &simulator) = 0;
|
||||
|
||||
//! Last cache
|
||||
|
||||
Reference in New Issue
Block a user