mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #697 Data cache traits renamed with T prefix.
This commit is contained in:
@@ -280,7 +280,7 @@ namespace BlackMisc
|
||||
|
||||
/*!
|
||||
* Class template for accessing a specific value in the CDataCache.
|
||||
* \tparam Trait A subclass of BlackMisc::CDataTrait that identifies the value's key and other metadata.
|
||||
* \tparam Trait A subclass of BlackMisc::TDataTrait that identifies the value's key and other metadata.
|
||||
*/
|
||||
template <typename Trait>
|
||||
class CData : public BlackMisc::CCached<typename Trait::type>
|
||||
@@ -363,7 +363,7 @@ namespace BlackMisc
|
||||
|
||||
/*!
|
||||
* Class template for read-only access to a specific value in the CDataCache.
|
||||
* \tparam Trait A subclass of BlackMisc::CDataTrait that identifies the value's key and other metadata.
|
||||
* \tparam Trait A subclass of BlackMisc::TDataTrait that identifies the value's key and other metadata.
|
||||
*/
|
||||
template <typename Trait>
|
||||
class CDataReadOnly : public BlackMisc::CData<Trait>
|
||||
@@ -385,7 +385,7 @@ namespace BlackMisc
|
||||
* Base class for traits to be used as template argument to BlackMisc::CData.
|
||||
*/
|
||||
template <typename T>
|
||||
struct CDataTrait
|
||||
struct TDataTrait
|
||||
{
|
||||
//! Data type of the value.
|
||||
using type = T;
|
||||
@@ -417,13 +417,13 @@ namespace BlackMisc
|
||||
static constexpr bool isDeferred() { return false; }
|
||||
|
||||
//! Deleted default constructor.
|
||||
CDataTrait() = delete;
|
||||
TDataTrait() = delete;
|
||||
|
||||
//! Deleted copy constructor.
|
||||
CDataTrait(const CDataTrait &) = delete;
|
||||
TDataTrait(const TDataTrait &) = delete;
|
||||
|
||||
//! Deleted copy assignment operator.
|
||||
CDataTrait &operator =(const CDataTrait &) = delete;
|
||||
TDataTrait &operator =(const TDataTrait &) = delete;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace BlackMisc
|
||||
namespace Data
|
||||
{
|
||||
//! Trait for model cache
|
||||
struct ModelCache : public BlackMisc::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
struct TModelCache : public BlackMisc::TDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
@@ -38,35 +38,35 @@ namespace BlackMisc
|
||||
//! @{
|
||||
|
||||
//! XPlane
|
||||
struct ModelCacheXP : public ModelCache
|
||||
struct TModelCacheXP : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelcachexp"; }
|
||||
};
|
||||
|
||||
//! FSX
|
||||
struct ModelCacheFsx : public ModelCache
|
||||
struct TModelCacheFsx : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelcachefsx"; }
|
||||
};
|
||||
|
||||
//! FS9
|
||||
struct ModelCacheFs9 : public ModelCache
|
||||
struct TModelCacheFs9 : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelcachefs9"; }
|
||||
};
|
||||
|
||||
//! P3D
|
||||
struct ModelCacheP3D : public ModelCache
|
||||
struct TModelCacheP3D : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelcachep3d"; }
|
||||
};
|
||||
|
||||
//! Last selection
|
||||
struct ModelCacheLastSelection : public BlackMisc::CDataTrait<BlackMisc::Simulation::CSimulatorInfo>
|
||||
struct TModelCacheLastSelection : public BlackMisc::TDataTrait<BlackMisc::Simulation::CSimulatorInfo>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CSimulatorInfo &defaultValue()
|
||||
@@ -87,35 +87,35 @@ namespace BlackMisc
|
||||
//! @{
|
||||
|
||||
//! XPlane
|
||||
struct ModelSetCacheXP : public ModelCache
|
||||
struct TModelSetCacheXP : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelsetxp"; }
|
||||
};
|
||||
|
||||
//! FSX
|
||||
struct ModelSetCacheFsx : public ModelCache
|
||||
struct TModelSetCacheFsx : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelsetfsx"; }
|
||||
};
|
||||
|
||||
//! FS9
|
||||
struct ModelSetCacheFs9 : public ModelCache
|
||||
struct TModelSetCacheFs9 : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelsetfs9"; }
|
||||
};
|
||||
|
||||
//! P3D
|
||||
struct ModelSetCacheP3D : public ModelCache
|
||||
struct TModelSetCacheP3D : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "modelsetp3d"; }
|
||||
};
|
||||
|
||||
//! Last selection
|
||||
struct ModelSetLastSelection : public BlackMisc::CDataTrait<BlackMisc::Simulation::CSimulatorInfo>
|
||||
struct TModelSetLastSelection : public BlackMisc::TDataTrait<BlackMisc::Simulation::CSimulatorInfo>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CSimulatorInfo &defaultValue()
|
||||
@@ -133,7 +133,7 @@ namespace BlackMisc
|
||||
//! @}
|
||||
|
||||
//! Trait for vPilot derived models
|
||||
struct VPilotAircraftModels : public ModelCache
|
||||
struct TVPilotAircraftModels : public TModelCache
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "vpilot/models"; }
|
||||
@@ -234,11 +234,11 @@ namespace BlackMisc
|
||||
//! @}
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheFsx> m_modelCacheFsx {this, &CModelCaches::changedFsx }; //!< FSX cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheFs9> m_modelCacheFs9 {this, &CModelCaches::changedFs9 }; //!< FS9 cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheP3D> m_modelCacheP3D {this, &CModelCaches::changedP3D }; //!< P3D cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheXP> m_modelCacheXP {this, &CModelCaches::changedXP }; //!< XP cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheLastSelection> m_currentSimulator { this }; //!< current simulator
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelCacheFsx> m_modelCacheFsx {this, &CModelCaches::changedFsx }; //!< FSX cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelCacheFs9> m_modelCacheFs9 {this, &CModelCaches::changedFs9 }; //!< FS9 cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelCacheP3D> m_modelCacheP3D {this, &CModelCaches::changedP3D }; //!< P3D cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelCacheXP> m_modelCacheXP {this, &CModelCaches::changedXP }; //!< XP cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelCacheLastSelection> m_currentSimulator { this }; //!< current simulator
|
||||
|
||||
//! Non virtaul version (used in ctor)
|
||||
void syncronizeCacheImpl(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
@@ -265,11 +265,11 @@ namespace BlackMisc
|
||||
//! @}
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelSetCacheFsx> m_modelCacheFsx {this, &CModelSetCaches::changedFsx }; //!< FSX cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelSetCacheFs9> m_modelCacheFs9 {this, &CModelSetCaches::changedFs9}; //!< FS9 cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelSetCacheP3D> m_modelCacheP3D {this, &CModelSetCaches::changedP3D }; //!< P3D cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelSetCacheXP> m_modelCacheXP {this, &CModelSetCaches::changedXP }; //!< XP cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelSetLastSelection> m_currentSimulator { this }; //!< current simulator
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelSetCacheFsx> m_modelCacheFsx {this, &CModelSetCaches::changedFsx }; //!< FSX cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelSetCacheFs9> m_modelCacheFs9 {this, &CModelSetCaches::changedFs9}; //!< FS9 cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelSetCacheP3D> m_modelCacheP3D {this, &CModelSetCaches::changedP3D }; //!< P3D cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelSetCacheXP> m_modelCacheXP {this, &CModelSetCaches::changedXP }; //!< XP cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TModelSetLastSelection> m_currentSimulator { this }; //!< current simulator
|
||||
|
||||
//! Non virtaul version (used in ctor)
|
||||
void syncronizeCacheImpl(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace BlackMisc
|
||||
CVPilotModelRuleSet m_rules; //!< rules list
|
||||
bool m_asyncLoadInProgress = false; //!< Asynchronous load in progress
|
||||
bool m_shutdown = false; //!< Shutdown
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::VPilotAircraftModels> m_cachedVPilotModels { this, &CVPilotRulesReader::ps_onVPilotCacheChanged }; //!< cache for latest vPilot rules
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TVPilotAircraftModels> m_cachedVPilotModels { this, &CVPilotRulesReader::ps_onVPilotCacheChanged }; //!< cache for latest vPilot rules
|
||||
mutable QReadWriteLock m_lockData;
|
||||
|
||||
//! Read single file and do parsing
|
||||
|
||||
Reference in New Issue
Block a user