mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -24,74 +24,71 @@
|
||||
#include <QMetaType>
|
||||
#include <QHash>
|
||||
|
||||
namespace BlackMisc
|
||||
namespace BlackMisc::Aviation
|
||||
{
|
||||
namespace Aviation
|
||||
//! Value object for a list of ATC stations.
|
||||
class BLACKMISC_EXPORT CAtcStationList :
|
||||
public CSequence<CAtcStation>,
|
||||
public Aviation::ICallsignObjectList<CAtcStation, CAtcStationList>,
|
||||
public Geo::IGeoObjectWithRelativePositionList<CAtcStation, CAtcStationList>,
|
||||
public Mixin::MetaType<CAtcStationList>
|
||||
{
|
||||
//! Value object for a list of ATC stations.
|
||||
class BLACKMISC_EXPORT CAtcStationList :
|
||||
public CSequence<CAtcStation>,
|
||||
public Aviation::ICallsignObjectList<CAtcStation, CAtcStationList>,
|
||||
public Geo::IGeoObjectWithRelativePositionList<CAtcStation, CAtcStationList>,
|
||||
public Mixin::MetaType<CAtcStationList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAtcStationList)
|
||||
using CSequence::CSequence;
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAtcStationList)
|
||||
using CSequence::CSequence;
|
||||
|
||||
//! Default constructor.
|
||||
CAtcStationList();
|
||||
//! Default constructor.
|
||||
CAtcStationList();
|
||||
|
||||
//! Construct from a base class object.
|
||||
CAtcStationList(const CSequence<CAtcStation> &other);
|
||||
//! Construct from a base class object.
|
||||
CAtcStationList(const CSequence<CAtcStation> &other);
|
||||
|
||||
//! Find 0..n stations tuned in frequency of COM unit (with 25kHz channel spacing)
|
||||
CAtcStationList findIfComUnitTunedIn25KHz(const CComSystem &comUnit) const;
|
||||
//! Find 0..n stations tuned in frequency of COM unit (with 25kHz channel spacing)
|
||||
CAtcStationList findIfComUnitTunedIn25KHz(const CComSystem &comUnit) const;
|
||||
|
||||
//! Find 0..n stations tuned in frequency of COM unit (with channel spacing)
|
||||
CAtcStationList findIfComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
|
||||
//! Find 0..n stations tuned in frequency of COM unit (with channel spacing)
|
||||
CAtcStationList findIfComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
|
||||
|
||||
//! Any stations tuned in frequency of COM unit (with channel spacing)
|
||||
bool hasComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
|
||||
//! Any stations tuned in frequency of COM unit (with channel spacing)
|
||||
bool hasComUnitTunedInChannelSpacing(const CComSystem &comUnit) const;
|
||||
|
||||
//! Find 0..n stations within channel spacing
|
||||
CAtcStationList findIfFrequencyIsWithinSpacing(const PhysicalQuantities::CFrequency &frequency, CComSystem::ChannelSpacing spacing);
|
||||
//! Find 0..n stations within channel spacing
|
||||
CAtcStationList findIfFrequencyIsWithinSpacing(const PhysicalQuantities::CFrequency &frequency, CComSystem::ChannelSpacing spacing);
|
||||
|
||||
//! Update if message changed
|
||||
bool updateIfMessageChanged(const CInformationMessage &im, const CCallsign &callsign, bool overrideWithNewer);
|
||||
//! Update if message changed
|
||||
bool updateIfMessageChanged(const CInformationMessage &im, const CCallsign &callsign, bool overrideWithNewer);
|
||||
|
||||
//! Set online status
|
||||
int setOnline(const CCallsign &callsign, bool online);
|
||||
//! Set online status
|
||||
int setOnline(const CCallsign &callsign, bool online);
|
||||
|
||||
//! Find 0..n stations with valid COM frequency
|
||||
//! \sa CAtcStation::hasValidFrequency
|
||||
CAtcStationList stationsWithValidFrequency() const;
|
||||
//! Find 0..n stations with valid COM frequency
|
||||
//! \sa CAtcStation::hasValidFrequency
|
||||
CAtcStationList stationsWithValidFrequency() const;
|
||||
|
||||
//! All controllers (with valid data)
|
||||
Network::CUserList getControllers() const;
|
||||
//! All controllers (with valid data)
|
||||
Network::CUserList getControllers() const;
|
||||
|
||||
//! Remove if marked outside of range
|
||||
int removeIfOutsideRange();
|
||||
//! Remove if marked outside of range
|
||||
int removeIfOutsideRange();
|
||||
|
||||
//! Those in range
|
||||
CAtcStationList findInRange() const;
|
||||
//! Those in range
|
||||
CAtcStationList findInRange() const;
|
||||
|
||||
//! Synchronize with ATC station representing booking information.
|
||||
//! Both sides (booking, online station) will be updated.
|
||||
//! \pre Can be used only if the stored data in this list are online ATC stations
|
||||
int synchronizeWithBookedStation(CAtcStation &bookedAtcStation);
|
||||
//! Synchronize with ATC station representing booking information.
|
||||
//! Both sides (booking, online station) will be updated.
|
||||
//! \pre Can be used only if the stored data in this list are online ATC stations
|
||||
int synchronizeWithBookedStation(CAtcStation &bookedAtcStation);
|
||||
|
||||
//! Sort by ATC suffix sort order and distance
|
||||
void sortByAtcSuffixSortOrderAndDistance();
|
||||
//! Sort by ATC suffix sort order and distance
|
||||
void sortByAtcSuffixSortOrderAndDistance();
|
||||
|
||||
//! Sorted by ATC suffix sort order and distance
|
||||
CAtcStationList sortedByAtcSuffixSortOrderAndDistance() const;
|
||||
//! Sorted by ATC suffix sort order and distance
|
||||
CAtcStationList sortedByAtcSuffixSortOrderAndDistance() const;
|
||||
|
||||
//! Split per suffix
|
||||
//! \remark sort can be disabled if already sorted
|
||||
QHash<QString, CAtcStationList> splitPerSuffix(bool sort = true) const;
|
||||
};
|
||||
} //namespace
|
||||
//! Split per suffix
|
||||
//! \remark sort can be disabled if already sorted
|
||||
QHash<QString, CAtcStationList> splitPerSuffix(bool sort = true) const;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAtcStationList)
|
||||
|
||||
Reference in New Issue
Block a user