swift
atcstationlist.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_AVIATION_ATCSTATIONLIST_H
7 #define SWIFT_MISC_AVIATION_ATCSTATIONLIST_H
8 
9 #include <QHash>
10 #include <QMetaType>
11 
15 #include "misc/collection.h"
16 #include "misc/geo/geoobjectlist.h"
17 #include "misc/network/userlist.h"
18 #include "misc/pq/frequency.h"
19 #include "misc/sequence.h"
20 #include "misc/swiftmiscexport.h"
21 
22 SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::aviation, CAtcStation, CAtcStationList)
23 
24 namespace swift::misc::aviation
25 {
28  public CSequence<CAtcStation>,
29  public aviation::ICallsignObjectList<CAtcStation, CAtcStationList>,
30  public geo::IGeoObjectWithRelativePositionList<CAtcStation, CAtcStationList>,
31  public mixin::MetaType<CAtcStationList>
32  {
33  public:
36 
39 
42 
44  CAtcStationList findIfComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
45 
47  bool hasComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
48 
50  CAtcStationList findIfFrequencyIsWithinSpacing(const physical_quantities::CFrequency &frequency);
51 
53  bool updateIfMessageChanged(const CInformationMessage &im, const CCallsign &callsign, bool overrideWithNewer);
54 
56  int setOnline(const CCallsign &callsign, bool online);
57 
60  CAtcStationList stationsWithValidFrequency() const;
61 
63  network::CUserList getControllers() const;
64 
66  int removeIfOutsideRange();
67 
69  CAtcStationList findInRange() const;
70 
72  void sortByAtcSuffixSortOrderAndDistance();
73 
75  CAtcStationList sortedByAtcSuffixSortOrderAndDistance() const;
76 
79  QHash<QString, CAtcStationList> splitPerSuffix(bool sort = true) const;
80  };
81 } // namespace swift::misc::aviation
82 
85 
86 #endif // SWIFT_MISC_AVIATION_ATCSTATIONLIST_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 for a list of ATC stations.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
COM system (aka "radio")
Definition: comsystem.h:37
Value object encapsulating information message (ATIS, METAR, TAF)
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
#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 ...
#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.