refs #863 Interpolator inheritance based on CRTP rather than virtual methods.

This commit is contained in:
Mathew Sutcliffe
2017-01-18 01:22:12 +00:00
parent 1c2533f5d2
commit 9c918b8799
8 changed files with 87 additions and 58 deletions

View File

@@ -50,7 +50,7 @@ namespace BlackSimPlugin
void setHostAddress(const QString &hostAddress);
//! Get interpolator
BlackMisc::Simulation::IInterpolator *getInterpolator() { return &m_interpolator; }
BlackMisc::Simulation::CInterpolatorLinear *getInterpolator() { return &m_interpolator; }
//! Set interpolation setup
//! \threadsafe

View File

@@ -16,7 +16,7 @@
#include "simconnectdatadefinition.h"
#include <QSharedPointer>
namespace BlackMisc { namespace Simulation { class IInterpolator; } }
namespace BlackMisc { namespace Simulation { class CInterpolatorLinear; } }
namespace BlackSimPlugin
{
namespace Fsx
@@ -44,7 +44,7 @@ namespace BlackSimPlugin
const QString &getAircraftModelString() const { return m_aircraft.getModelString(); }
//! Interpolator
BlackMisc::Simulation::IInterpolator *getInterpolator() const { return m_interpolator.data(); }
BlackMisc::Simulation::CInterpolatorLinear *getInterpolator() const { return m_interpolator.data(); }
//! Get current lights (requested from simulator)
const BlackMisc::Aviation::CAircraftLights &getCurrentLightsInSimulator() const { return m_currentLightsInSim; }
@@ -122,7 +122,7 @@ namespace BlackSimPlugin
BlackMisc::Aviation::CAircraftLights m_currentLightsInSim { nullptr }; //!< current lights to know state for toggling
BlackMisc::Aviation::CAircraftLights m_lightsAsSent { nullptr }; //!< lights as sent to simulator
SIMCONNECT_PERIOD m_requestSimDataPeriod = SIMCONNECT_PERIOD_NEVER; //!< how often do we query ground elevation
QSharedPointer<BlackMisc::Simulation::IInterpolator> m_interpolator; //!< shared pointer because CSimConnectObject can be copied
QSharedPointer<BlackMisc::Simulation::CInterpolatorLinear> m_interpolator; //!< shared pointer because CSimConnectObject can be copied
};
//! Simulator objects (aka AI aircraft)