Public Types | |
template<long int Num, long int Den> | |
using | Power = Qty< typename std::ratio< Num *L, Den *DL >::type, typename std::ratio< Num *E, Den *DE >::type, typename std::ratio< Num *Q, Den *DQ >::type > |
General power type. | |
using | Type = Power< 1, 1 > |
Our type. | |
using | Squared = Power< 2, 1 > |
The squared type. | |
using | Inverse = Power<-1, 1 > |
The inverse type. | |
using | Sqrt = Power< 1, 2 > |
The sqrt type. | |
Public Member Functions | |
constexpr | Qty () |
Default constructor to 0. | |
constexpr | Qty (ZeroUnit) |
Default constructor to 0. | |
template<typename U > | |
constexpr | Qty (const U &q, double factor=1.0, enable_if_same_qty< void, Type, U > *=nullptr) |
Constructor from a compatible quantity. | |
constexpr double | rawValue () const |
Access to the raw value. Breaks consistency. | |
Type & | operator*= (double x) |
Assignment multiplication by dimensionless number. | |
Type & | operator/= (double x) |
Assignment division by dimensionless number. | |
Type & | operator+= (const Type &x) |
Assignment addition with compatible quantity. | |
Type & | operator-= (const Type &x) |
Assignment subtraction with compatible quantity. | |
Static Public Member Functions | |
static std::string | className () |
The name of the class for persistent IO. | |
static constexpr Type | baseunit () |
Basic unit of this quantity. | |
Private Member Functions | |
constexpr | Qty (double val) |
Constructor from raw values. Breaks consistency. | |
Private Attributes | |
double | rawValue_ |
The raw value in units of Qty::baseunit(). | |
Definition at line 76 of file PhysicalQty.h.