mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 05:05:38 +08:00
Ref T231, Ref T238 maxValue for PQs
Remark: max() as function name caused compile errors
This commit is contained in:
@@ -47,11 +47,11 @@ namespace BlackMisc
|
||||
*/
|
||||
template <class MU, class PQ> class CPhysicalQuantity :
|
||||
public Mixin::DBusOperators<CPhysicalQuantity<MU, PQ>>,
|
||||
public Mixin::JsonOperators<CPhysicalQuantity<MU, PQ>>,
|
||||
public Mixin::Index<PQ>,
|
||||
public Mixin::MetaType<PQ>,
|
||||
public Mixin::String<PQ>,
|
||||
public Mixin::Icon<CPhysicalQuantity<MU, PQ>>
|
||||
public Mixin::JsonOperators<CPhysicalQuantity<MU, PQ>>,
|
||||
public Mixin::Index<PQ>,
|
||||
public Mixin::MetaType<PQ>,
|
||||
public Mixin::String<PQ>,
|
||||
public Mixin::Icon<CPhysicalQuantity<MU, PQ>>
|
||||
{
|
||||
//! \copydoc CValueObject::compare
|
||||
friend int compare(const PQ &a, const PQ &b) { return compareImpl(a, b); }
|
||||
@@ -234,6 +234,12 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Maximum of 2 quantities
|
||||
static const PQ &maxValue(const PQ &pq1, const PQ &pq2);
|
||||
|
||||
//! Minimum of 2 quantities
|
||||
static const PQ &minValue(const PQ &pq1, const PQ &pq2);
|
||||
|
||||
protected:
|
||||
//! Constructor with double
|
||||
CPhysicalQuantity(double value, MU unit);
|
||||
|
||||
Reference in New Issue
Block a user