swift
interpolationsetupprovider.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2018 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_INTERPOLATIONSETUPPROVIDER_H
7 #define SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATIONSETUPPROVIDER_H
8 
9 #include <QMap>
10 #include <QReadWriteLock>
11 
13 #include "misc/provider.h"
16 
17 namespace swift::misc::simulation
18 {
21  {
22  public:
25 
29  getInterpolationSetupPerCallsignOrDefault(const aviation::CCallsign &callsign) const;
30 
33  CInterpolationSetupList getInterpolationSetupsPerCallsign() const;
34 
37  bool hasSetupsPerCallsign() const;
38 
41  bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true);
42 
45  virtual CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
46 
49  aviation::CCallsignSet getLogCallsigns() const;
50 
53  bool isLogCallsign(const aviation::CCallsign &callsign) const;
54 
57  bool setInterpolationMode(const QString &modeAsString, const aviation::CCallsign &callsign);
58 
61  bool setLogInterpolation(bool log, const aviation::CCallsign &callsign);
62 
63  protected:
66  virtual bool setInterpolationSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup);
67 
70  virtual bool setInterpolationSetupPerCallsign(const CInterpolationAndRenderingSetupPerCallsign &setup,
71  const aviation::CCallsign &callsign,
72  bool removeGlobalSetup = true);
73 
76  void setLogCallsign(bool log, const aviation::CCallsign &callsign);
77 
79  bool removeInterpolationSetupPerCallsign(const aviation::CCallsign &callsign);
80 
83  void clearInterpolationLogCallsigns();
84 
87  int clearInterpolationSetupsPerCallsign();
88 
91  bool logAnyCallsign() const;
92 
95  SetupsPerCallsign getSetupsPerCallsign() const;
96 
99 
100  private:
102  SetupsPerCallsign m_setupsPerCallsign;
103  mutable QReadWriteLock m_lockSetup;
104  };
105 
107  class SWIFT_MISC_EXPORT CInterpolationSetupAware : public IProviderAware<IInterpolationSetupProvider>
108  {
109  virtual void anchor();
110 
111  public:
114  getInterpolationSetupPerCallsignOrDefault(const aviation::CCallsign &callsign) const;
115 
117  CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
118 
119  protected:
122 
125 
127  void setInterpolationSetupProvider(IInterpolationSetupProvider *provider) { this->setProvider(provider); }
128  };
129 } // namespace swift::misc::simulation
130 
132  "org.swift-project.misc::network::iinterpolationsetupprovider")
133 
134 #endif // SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATIONSETUPPROVIDER_H
Base class of provider aware classes.
Definition: provider.h:41
Base class for providers.
Definition: provider.h:19
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object for a set of callsigns.
Definition: callsignset.h:26
Value object for interpolator and rendering per callsign.
Class which can be directly used to access an.
CInterpolationSetupAware(IInterpolationSetupProvider *setupProvider)
Constructor.
void setInterpolationSetupProvider(IInterpolationSetupProvider *provider)
Provider.
Direct in memory access to interpolation setup, normally implemented by simulator.
virtual void emitInterpolationSetupChanged()
Pseudo signal, override to emit signal.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.