swift
Loading...
Searching...
No Matches
interpolatormulti.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORMULTI_H
7#define SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORMULTI_H
8
12
13namespace swift::misc::simulation
14{
50
56 {
57 public:
60
64 CInterpolationLogger *logger = nullptr);
65
67 bool hasInterpolator() const { return !m_interpolator.isNull(); }
68
70 CInterpolatorMulti *interpolator() const { return m_interpolator.data(); }
71
73 operator CInterpolatorMulti *() const { return this->interpolator(); }
74
76 operator bool() const { return this->hasInterpolator(); }
77
79 bool operator!() const { return !this->hasInterpolator(); }
80
82 CInterpolatorMulti &operator*() const { return *this->interpolator(); }
83
85 CInterpolatorMulti *operator->() const { return this->interpolator(); }
86
87 private:
89 m_interpolator;
90 };
91} // namespace swift::misc::simulation
92
93#endif // SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORMULTI_H
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of an aircraft's situation.
Value object encapsulating information of a callsign.
Definition callsign.h:30
Aircraft model (used by another pilot, my models on disk).
Value object for interpolator and rendering per callsign.
Record internal state of interpolator for debugging.
Linear interpolator, calculation inbetween positions.
Multiplexed interpolator which allows switching between modes at runtime.
CInterpolatorMulti(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *p1, IInterpolationSetupProvider *p2, IRemoteAircraftProvider *p3, CInterpolationLogger *logger=nullptr)
Constructor.
void initCorrespondingModel(const CAircraftModel &model)
Init, or re-init the corressponding model.
CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoch, const CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber)
Get interpolated situation.
const aviation::CAircraftSituation & getLastInterpolatedSituation(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Latest interpolation result.
QString getInterpolatorInfo(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Info string.
const CStatusMessageList & getInterpolationMessages(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Interpolation messages.
void attachLogger(CInterpolationLogger *logger)
Attach an observer to read the interpolator's state for debugging.
CInterpolatorMulti * operator->() const
-> operator
bool hasInterpolator() const
Has interpolator initialized?
CInterpolatorMultiWrapper()=default
Default ctor, needed for QMap/QHash.
CInterpolatorMulti * interpolator() const
Interpolator.
Direct in memory access to interpolation setup, normally implemented by simulator.
Direct thread safe in memory access to remote aircraft.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.