swift
aircraftengine.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2014 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_AIRCRAFTENGINES_H
7 #define SWIFT_MISC_AVIATION_AIRCRAFTENGINES_H
8 
9 #include <QMetaType>
10 #include <QString>
11 
12 #include "misc/metaclass.h"
13 #include "misc/swiftmiscexport.h"
14 #include "misc/valueobject.h"
15 
16 SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::aviation, CAircraftEngine)
17 
18 namespace swift::misc::aviation
19 {
21  class SWIFT_MISC_EXPORT CAircraftEngine : public CValueObject<CAircraftEngine>
22  {
23  public:
26 
29  CAircraftEngine(int number, bool on);
30 
33  int getNumber() const { return m_number; }
34 
37  void setNumber(int number);
38 
40  bool isOn() const { return m_on; }
41 
43  void setOn(bool on) { m_on = on; }
44 
46  QString convertToQString(bool i18n = false) const;
47 
48  private:
49  int m_number = 1;
50  bool m_on = true;
51 
55  SWIFT_METAMEMBER(on));
56  };
57 } // namespace swift::misc::aviation
58 
60 
61 #endif // SWIFT_MISC_AVIATION_AIRCRAFTENGINES_H
Mix of the most commonly used mixin classes.
Definition: valueobject.h:114
Value object encapsulating information about aircraft's engines.
int getNumber() const
Get engine number.
void setOn(bool on)
Set to on/off.
#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
@ DisabledForJson
Element will be ignored during JSON serialization.
Definition: metaclass.h:206
#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