Ref T259, Ref T243 remove dummy interpolator

* As there are no longer situations/parts added to the interpolator /solely provided by provider) there is no overhead anymore and no need for the dummy interpolator.
* Furthermore switching the interpolator at runtime will become possible.
This commit is contained in:
Klaus Basan
2018-03-26 00:51:15 +02:00
parent 60c70c34f6
commit 7ae0649dd6
2 changed files with 0 additions and 74 deletions

View File

@@ -1,67 +0,0 @@
/* Copyright (C) 2017
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKMISC_SIMULATION_INTERPOLATORDUMMY_H
#define BLACKMISC_SIMULATION_INTERPOLATORDUMMY_H
#include "blackmisc/aviation/aircraftparts.h"
#include "blackmisc/aviation/aircraftsituation.h"
#include "blackmisc/aviation/callsign.h"
#include "blackmisc/simulation/interpolationlogger.h"
#include "blackmisc/simulation/interpolationrenderingsetup.h"
#include "blackmisc/simulation/interpolator.h"
namespace BlackMisc
{
namespace Simulation
{
/*!
* Dummy interpolator which does nothing.
*/
class BLACKMISC_EXPORT CInterpolatorDummy : public QObject
{
public:
//! Constructor
CInterpolatorDummy(const BlackMisc::Aviation::CCallsign &callsign, QObject *parent) : QObject(parent)
{
this->setObjectName("CInterpolatorDummy for " + callsign.asString());
}
//! \copydoc CInterpolator::getInterpolatedSituation
BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
qint64, const CInterpolationAndRenderingSetupPerCallsign &, CInterpolationStatus &) { return {}; }
//! \copydoc CInterpolator::getInterpolatedParts
BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
qint64, const CInterpolationAndRenderingSetupPerCallsign &, CPartsStatus &, bool = false) const { return {}; }
//! \copydoc CInterpolator::addAircraftSituation
void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &) {}
//! \copydoc CInterpolator::hasAircraftSituations
bool hasAircraftSituations() const { return false; }
//! \copydoc CInterpolator::addAircraftParts
void addAircraftParts(const BlackMisc::Aviation::CAircraftParts &) {}
//! \copydoc CInterpolator::hasAircraftParts
bool hasAircraftParts() const { return false; }
//! \copydoc CInterpolator::getInterpolatorInfo
QString getInterpolatorInfo() const { return this->objectName(); }
//! \copydoc CInterpolator::attachLogger
void attachLogger(CInterpolationLogger *) {}
};
} // ns
} // ns
#endif

View File

@@ -14,7 +14,6 @@
#include "blackmisc/simulation/interpolatorlinear.h"
#include "blackmisc/simulation/interpolatorspline.h"
#include "blackmisc/simulation/interpolatordummy.h"
namespace BlackMisc
{
@@ -89,13 +88,7 @@ namespace BlackMisc
private:
Mode m_mode = ModeSpline;
CInterpolatorSpline m_spline;
#ifdef QT_DEBUG
//! only in a dev.environment, otherwise replaced by low footprint dummy driver
CInterpolatorLinear m_linear;
#else
//! Low footprint dummy interpolator in non-debug compile
CInterpolatorDummy m_linear;
#endif
};
/**