20 template<
typename NUMERIC_TRAITS,
typename TRAIT =
void>
32 NumericType
value()
const;
35 QuantityType&
operator=(
const QuantityType& other);
36 QuantityType&
operator+=(
const QuantityType& other);
37 QuantityType&
operator-=(
const QuantityType& other);
38 QuantityType&
operator*=(
const QuantityType& other);
39 QuantityType&
operator/=(
const QuantityType& other);
51 template<
typename NUMERIC_TRAITS,
typename TRAIT>
52 bool operator<(const Quantity<NUMERIC_TRAITS, TRAIT>& lhs,
56 template<
typename NUMERIC_TRAITS,
typename TRAIT>
61 template<
typename NUMERIC_TRAITS,
typename TRAIT>
66 template<
typename NUMERIC_TRAITS,
typename TRAIT>
69 typename NUMERIC_TRAITS::Type k);
71 template<
typename NUMERIC_TRAITS,
typename TRAIT>
73 typename NUMERIC_TRAITS::Type k,
77 template<
typename NUMERIC_TRAITS,
typename TRAIT>
82 template<
typename NUMERIC_TRAITS,
typename TRAIT>
85 typename NUMERIC_TRAITS::Type k);
87 template<
typename NUMERIC_TRAITS,
typename TRAIT>
89 typename NUMERIC_TRAITS::Type k,
93 template<
typename NUMERIC_TRAITS,
typename TRAIT>
98 template<
typename NUMERIC_TRAITS,
typename TRAIT>
101 typename NUMERIC_TRAITS::Type k);
103 template<
typename NUMERIC_TRAITS,
typename TRAIT>
105 typename NUMERIC_TRAITS::Type k,
109 template<
typename NUMERIC_TRAITS,
typename TRAIT>
114 template<
typename NUMERIC_TRAITS,
typename TRAIT>
117 typename NUMERIC_TRAITS::Type k);
119 template<
typename NUMERIC_TRAITS,
typename TRAIT>
121 typename NUMERIC_TRAITS::Type k,
124 template<
typename TYPE>
129 {
return static_cast<TYPE
>(0); }
148 template<
typename NUMERIC_TRAITS,
typename TRAIT>
150 : m_value(NUMERIC_TRAITS::
zero())
154 template<
typename NUMERIC_TRAITS,
typename TRAIT>
160 template<
typename NUMERIC_TRAITS,
typename TRAIT>
162 : m_value(other.value())
172 template<
typename NUMERIC_TRAITS,
typename TRAIT>
178 template<
typename NUMERIC_TRAITS,
typename TRAIT>
184 template<
typename NUMERIC_TRAITS,
typename TRAIT>
189 m_value = other.
value();
193 template<
typename NUMERIC_TRAITS,
typename TRAIT>
198 m_value += other.
value();
202 template<
typename NUMERIC_TRAITS,
typename TRAIT>
207 m_value -= other.
value();
211 template<
typename NUMERIC_TRAITS,
typename TRAIT>
216 m_value *= other.
value();
220 template<
typename NUMERIC_TRAITS,
typename TRAIT>
225 m_value /= other.
value();
229 template<
typename NUMERIC_TRAITS,
typename TRAIT>
237 template<
typename NUMERIC_TRAITS,
typename TRAIT>
245 template<
typename NUMERIC_TRAITS,
typename TRAIT>
253 template<
typename NUMERIC_TRAITS,
typename TRAIT>
262 template<
typename NUMERIC_TRAITS,
typename TRAIT>
263 bool operator<(const Quantity<NUMERIC_TRAITS, TRAIT>& lhs,
268 return lhs.
value() < rhs.value();
273 template<
typename NUMERIC_TRAITS,
typename TRAIT>
285 template<
typename NUMERIC_TRAITS,
typename TRAIT>
294 template<
typename NUMERIC_TRAITS,
typename TRAIT>
297 typename NUMERIC_TRAITS::Type k)
303 template<
typename NUMERIC_TRAITS,
typename TRAIT>
305 typename NUMERIC_TRAITS::Type k,
314 template<
typename NUMERIC_TRAITS,
typename TRAIT>
323 template<
typename NUMERIC_TRAITS,
typename TRAIT>
326 typename NUMERIC_TRAITS::Type k)
332 template<
typename NUMERIC_TRAITS,
typename TRAIT>
334 typename NUMERIC_TRAITS::Type k,
343 template<
typename NUMERIC_TRAITS,
typename TRAIT>
352 template<
typename NUMERIC_TRAITS,
typename TRAIT>
355 typename NUMERIC_TRAITS::Type k)
361 template<
typename NUMERIC_TRAITS,
typename TRAIT>
363 typename NUMERIC_TRAITS::Type k,
372 template<
typename NUMERIC_TRAITS,
typename TRAIT>
381 template<
typename NUMERIC_TRAITS,
typename TRAIT>
384 typename NUMERIC_TRAITS::Type k)
390 template<
typename NUMERIC_TRAITS,
typename TRAIT>
392 typename NUMERIC_TRAITS::Type k,
QuantityType & operator/=(const QuantityType &other)
Definition: quantity.h:222
Quantity()
Definition: quantity.h:149
Definition: basic_shared_pointer.h:20
bool operator>(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:274
const Quantity< NUMERIC_TRAITS, TRAIT > operator/(typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:391
QuantityType & operator+=(const QuantityType &other)
Definition: quantity.h:195
QuantityType & operator=(const QuantityType &other)
Definition: quantity.h:186
const Quantity< NUMERIC_TRAITS, TRAIT > operator/(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
TYPE Type
Definition: quantity.h:127
const Quantity< NUMERIC_TRAITS, TRAIT > operator-(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
Definition: quantity.h:324
NumericTraits< float > FloatNumericTraits
Definition: quantity.h:133
const Quantity< NUMERIC_TRAITS, TRAIT > operator/(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
Definition: quantity.h:382
const Quantity< NUMERIC_TRAITS, TRAIT > operator-(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
QuantityType & operator*=(const QuantityType &other)
Definition: quantity.h:213
const Quantity< NUMERIC_TRAITS, TRAIT > operator*(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
Definition: quantity.h:353
static TYPE zero()
Definition: quantity.h:128
const Quantity< NUMERIC_TRAITS, TRAIT > operator/(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:373
QuantityType & operator-=(const QuantityType &other)
Definition: quantity.h:204
const Quantity< NUMERIC_TRAITS, TRAIT > operator+(typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:304
const Quantity< NUMERIC_TRAITS, TRAIT > operator-(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:315
Definition: quantity.h:125
NumericTraits< int > IntNumericTraits
Definition: quantity.h:134
NUMERIC_TRAITS::Type NumericType
Definition: quantity.h:24
const Quantity< NUMERIC_TRAITS, TRAIT > operator+(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
Definition: quantity.h:295
const Quantity< NUMERIC_TRAITS, TRAIT > operator+(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
const Quantity< NUMERIC_TRAITS, TRAIT > operator*(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
const Quantity< NUMERIC_TRAITS, TRAIT > operator*(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:344
const Quantity< NUMERIC_TRAITS, TRAIT > operator+(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:286
Represents an amount of a certain unit.
Definition: quantity.h:21
NumericTraits< double > DoubleNumericTraits
Definition: quantity.h:132
Quantity< NUMERIC_TRAITS, TRAIT > QuantityType
Definition: quantity.h:25
NumericType value() const
Definition: quantity.h:173
void setValue(NumericType v)
Definition: quantity.h:179
bool operator>(const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
const Quantity< NUMERIC_TRAITS, TRAIT > operator-(typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:333
const Quantity< NUMERIC_TRAITS, TRAIT > operator*(typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
Definition: quantity.h:362