swift
speed.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_PQ_SPEED_H
7 #define SWIFT_MISC_PQ_SPEED_H
8 
9 #include <QPair>
10 
12 #include "misc/swiftmiscexport.h"
13 
14 namespace swift::misc::physical_quantities
15 {
19  class SWIFT_MISC_EXPORT CSpeed : public CPhysicalQuantity<CSpeedUnit, CSpeed>
20  {
21  public:
23  CSpeed() : CPhysicalQuantity(0, CSpeedUnit::defaultUnit()) {}
24 
26  CSpeed(double value, const CSpeedUnit &unit) : CPhysicalQuantity(value, unit) {}
27 
29  CSpeed(const QString &unitString) : CPhysicalQuantity(unitString) {}
30  };
31 
32  using CSpeedPair = QPair<CSpeed, CSpeed>;
33 } // namespace swift::misc::physical_quantities
34 
37 
38 #endif // SWIFT_MISC_PQ_SPEED_H
A physical quantity such as "5m", "20s", "1500ft/s".
CSpeed(const QString &unitString)
Constructor by parsed string, e.g. 10m.
Definition: speed.h:29
CSpeed(double value, const CSpeedUnit &unit)
Init by double value.
Definition: speed.h:26
CSpeed()
Default constructor.
Definition: speed.h:23
Specialized class for speed units (m/s, ft/s, NM/h).
Definition: units.h:778
QPair< CSpeed, CSpeed > CSpeedPair
Pair of speeds.
Definition: speed.h:32
#define SWIFT_MISC_EXPORT
Export a class or function from the library.