swift
simulatedaircraftlist.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 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_SIMULATEDNAIRCRAFTLIST_H
7 #define SWIFT_MISC_SIMULATION_SIMULATEDNAIRCRAFTLIST_H
8 
9 #include <QMetaType>
10 
13 #include "misc/collection.h"
14 #include "misc/geo/geoobjectlist.h"
15 #include "misc/network/userlist.h"
16 #include "misc/sequence.h"
18 #include "misc/swiftmiscexport.h"
19 
20 SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::simulation, CSimulatedAircraft, CSimulatedAircraftList)
21 
22 namespace swift::misc
23 {
24  namespace aviation
25  {
26  class CAircraftParts;
27  class CCallsign;
28  } // namespace aviation
29  namespace simulation
30  {
31  class CAircraftModel;
32  class CSimulatedAircraft;
33  } // namespace simulation
34  namespace simulation
35  {
38  public CSequence<CSimulatedAircraft>,
39  public aviation::ICallsignObjectList<CSimulatedAircraft, CSimulatedAircraftList>,
40  public geo::IGeoObjectWithRelativePositionList<CSimulatedAircraft, CSimulatedAircraftList>,
41  public mixin::MetaType<CSimulatedAircraftList>
42  {
43  public:
46 
49 
52 
54  network::CUserList getPilots() const;
55 
57  CAircraftModelList getModels() const;
58 
60  Q_REQUIRED_RESULT CSimulatedAircraftList findByEnabled(bool enabled) const;
61 
63  Q_REQUIRED_RESULT CSimulatedAircraftList findByRendered(bool rendered) const;
64 
66  CSimulatedAircraftList findByVtol(bool vtol) const;
67 
69  aviation::CCallsignSet getCallsignsWithSynchronizedParts() const;
70 
73  bool updateWithVatsimDataFileData(CSimulatedAircraft &aircraftToBeUpdated) const;
74 
76  void markAllAsNotRendered();
77 
79  int setRendered(const aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
80 
82  int setCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg,
83  bool onlyFirst = true);
84 
86  int setEnabled(const aviation::CCallsign &callsign, bool enabled, bool onlyFirst);
87 
89  int setFastPositionUpdates(const aviation::CCallsign &callsign, bool fastPositions, bool onlyFirst = true);
90 
92  int setAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model,
93  bool onlyFirst = true);
94 
96  int setAircraftPartsSynchronized(const aviation::CCallsign &callsign, const aviation::CAircraftParts &parts,
97  bool onlyFirst = true);
98 
100  int setAircraftSituation(const aviation::CCallsign &callsign, const aviation::CAircraftSituation &situation,
101  bool onlyFirst = true);
102 
104  int setGroundElevationChecked(const aviation::CCallsign &callsign, const geo::CElevationPlane &elevation,
105  aviation::CAircraftSituation::GndElevationInfo info, bool onlyFirst = true);
106 
108  bool isEnabled(const aviation::CCallsign &callsign) const;
109 
111  bool isRendered(const aviation::CCallsign &callsign) const;
112 
114  bool replaceOrAddByCallsign(const CSimulatedAircraft &aircraft);
115 
117  int countEnabled() const;
118 
120  int countRendered() const;
121 
123  int countAircraftPartsSynchronized() const;
124 
126  void sortByDistanceToReferencePositionRenderedCallsign();
127  };
128 
131 
132  } // namespace simulation
133 } // namespace swift::misc
134 
138 
139 #endif // SWIFT_MISC_SIMULATION_SIMULATEDNAIRCRAFTLIST_H
Generic ordered container with value semantics.
Definition: collection.h:107
Generic sequential container with value semantics.
Definition: sequence.h:86
CSequence()=default
Default constructor.
Value object encapsulating information of aircraft's parts.
Definition: aircraftparts.h:26
Value object encapsulating information of an aircraft's situation.
GndElevationInfo
Where did we get elevation from?
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object for a set of callsigns.
Definition: callsignset.h:26
Plane of same elevation, can be a single point or larger area (e.g. airport)
List of objects with geo coordinates.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Definition: mixinmetatype.h:29
Value object encapsulating a list of voice rooms.
Definition: userlist.h:26
Physical unit length (length)
Definition: length.h:18
Aircraft model (used by another pilot, my models on disk)
Definition: aircraftmodel.h:71
Value object encapsulating a list of aircraft models.
Comprehensive information of an aircraft.
Value object encapsulating a list of aircraft.
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
Free functions in swift::misc.
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition: sequence.h:62
#define SWIFT_MISC_EXPORT
Export a class or function from the library.