swift
Loading...
Searching...
No Matches
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
15#include "misc/collection.h"
17#include "misc/sequence.h"
19
20SWIFT_DECLARE_COLLECTION_MIXINS(swift::misc::aviation, CCallsign, CCallsignSet)
21
22namespace swift::misc::aviation
23{
25 class SWIFT_MISC_EXPORT CCallsignSet : public CCollection<CCallsign>, public mixin::MetaType<CCallsignSet>
26 {
29
30 public:
32 CCallsignSet() = default;
33
35 CCallsignSet(const QStringList &callsigns, CCallsign::TypeHint typeHint = CCallsign::NoHint);
36
38 CCallsignSet(const CCallsign &callsign);
39
41 CCallsignSet(const CCollection<CCallsign> &other);
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
59
60#endif // SWIFT_MISC_AVIATION_CALLSIGNSET_H
Generic ordered container with value semantics.
Definition collection.h:113
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
static void registerMetadata()
Register metadata.
QStringList getCallsignStrings(bool sorted=false) const
The callsign strings.
QString getCallsignsAsString(bool sorted=false, const QString &separator=", ") const
Callsigns as string.
CCallsignSet()=default
Default constructor.
bool containsCallsign(const QString &callsign) const
Contains by string.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
#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 ...
#define SWIFT_MISC_EXPORT
Export a class or function from the library.