swift
facilitytype.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 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_NETWORK_FACILITYTYPE_H
7 #define SWIFT_MISC_NETWORK_FACILITYTYPE_H
8 
9 #include "misc/swiftmiscexport.h"
10 #include "misc/valueobject.h"
11 
12 SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::network, CFacilityType)
13 
14 namespace swift::misc::network
15 {
17  class SWIFT_MISC_EXPORT CFacilityType : public CValueObject<CFacilityType>
18  {
19  public:
22  {
23  OBS,
24  FSS,
25  DEL,
26  GND,
27  TWR,
28  APP,
29  CTR,
30  Unknown
31  };
32 
34  CFacilityType() = default;
35 
37  CFacilityType(FacilityType mode) : m_facilityType(mode) {}
38 
40  FacilityType getFacilityType() const { return m_facilityType; }
41 
43  void setFacilityType(FacilityType type) { m_facilityType = type; }
44 
46  QString convertToQString(bool i18n = false) const;
47 
48  private:
49  FacilityType m_facilityType = Unknown;
50 
53  SWIFT_METAMEMBER(facilityType));
54  };
55 } // namespace swift::misc::network
56 
57 Q_DECLARE_METATYPE(swift::misc::network::CFacilityType)
58 
59 #endif // SWIFT_MISC_NETWORK_FACILITYTYPE_H
Mix of the most commonly used mixin classes.
Definition: valueobject.h:114
Value object encapsulating the ATC facility type, e.g. TWR, DEP, APP.
Definition: facilitytype.h:18
FacilityType getFacilityType() const
Get type.
Definition: facilitytype.h:40
CFacilityType()=default
Default constructor.
CFacilityType(FacilityType mode)
Constructor.
Definition: facilitytype.h:37
void setFacilityType(FacilityType type)
Set type.
Definition: facilitytype.h:43
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition: metaclass.h:73
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition: metaclass.h:53
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...
Definition: valueobject.h:65