Ref T259, Ref T243 improvements of PQ

* null()
* allow chaining for makePositive
* abs()
This commit is contained in:
Klaus Basan
2018-03-07 01:28:08 +01:00
parent 67e8f94481
commit 5744c260c5
2 changed files with 27 additions and 4 deletions

View File

@@ -193,10 +193,13 @@ namespace BlackMisc
bool isNegativeWithEpsilonConsidered() const;
//! Make value always positive
void makePositive();
const PQ &makePositive();
//! Make value always negative
void makeNegative();
const PQ &makeNegative();
//! Absolute value (always >=0)
PQ abs() const;
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const;
@@ -240,6 +243,9 @@ namespace BlackMisc
//! Minimum of 2 quantities
static const PQ &minValue(const PQ &pq1, const PQ &pq2);
//! NULL PQ
static const PQ &null();
protected:
//! Constructor with double
CPhysicalQuantity(double value, MU unit);