swift
callsignset.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_CALLSIGNSET_H
7 #define SWIFT_MISC_AVIATION_CALLSIGNSET_H
8 
9 #include <tuple>
10 
11 #include <QMetaType>
12 #include <QStringList>
13 
14 #include "misc/aviation/callsign.h"
15 #include "misc/collection.h"
17 #include "misc/sequence.h"
18 #include "misc/swiftmiscexport.h"
19 
20 SWIFT_DECLARE_COLLECTION_MIXINS(swift::misc::aviation, CCallsign, CCallsignSet)
21 
22 namespace swift::misc::aviation
23 {
25  class SWIFT_MISC_EXPORT CCallsignSet : public CCollection<CCallsign>, public mixin::MetaType<CCallsignSet>
26  {
29 
30  public:
32  CCallsignSet();
33 
35  CCallsignSet(const QStringList &callsigns, CCallsign::TypeHint typeHint = CCallsign::NoHint);
36 
38  CCallsignSet(const CCallsign &callsign);
39 
42 
44  bool containsCallsign(const QString &callsign) const;
45 
47  QStringList getCallsignStrings(bool sorted = false) const;
48 
50  QString getCallsignsAsString(bool sorted = false, const QString &separator = ", ") const;
51 
53  static void registerMetadata();
54  };
55 } // namespace swift::misc::aviation
56 
57 Q_DECLARE_METATYPE(swift::misc::aviation::CCallsignSet)
59 
60 #endif // SWIFT_MISC_AVIATION_CALLSIGNSET_H
Generic ordered container with value semantics.
Definition: collection.h:107
CCollection()=default
Default constructor.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
TypeHint
Representing what.
Definition: callsign.h:44
Value object for a set of callsigns.
Definition: callsignset.h:26
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Definition: mixinmetatype.h:29
#define SWIFT_DECLARE_COLLECTION_MIXINS(Namespace, T, Set)
Explicit template declaration of mixins for a CCollection subclass to be placed near the top of the h...
Definition: collection.h:61
#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 ...
void registerMetadata()
Register all relevant metadata in Misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.