ome-xml
5.6.0
|
A quantity of a defined unit. More...
#include <ome/xml/model/primitives/Quantity.h>
Public Types | |
typedef Unit | unit_type |
The type of a unit. | |
typedef Value | value_type |
The type of a value. | |
Public Member Functions | |
Quantity () | |
Default construct a Quantity. | |
Quantity (value_type value, unit_type unit) | |
Construct a Quantity from a value and unit. More... | |
Quantity (const Quantity &quantity) | |
Copy construct a Quantity. More... | |
~Quantity () | |
Destructor. | |
value_type | getValue () const |
Get the value for this quantity. More... | |
unit_type | getUnit () const |
Get the unit for this quantity. More... | |
Quantity & | operator= (const Quantity &quantity) |
Assign the quantity from a quantity. More... | |
Quantity & | operator+= (const Quantity &quantity) |
Add a quantity to the quantity. More... | |
Quantity & | operator-= (const Quantity &quantity) |
Subtract a quantity from the quantity. More... | |
Quantity & | operator*= (const value_type &value) |
Multiply the quantity by a value. More... | |
Quantity & | operator/= (const value_type &value) |
Divide the quantity by a value. More... | |
Quantity & | operator%= (const value_type &value) |
Modulo of the quantity by a value. More... | |
Quantity & | operator++ () |
Increment the quantity by one. More... | |
Quantity & | operator-- () |
Decrement the quantity by one. More... | |
bool | operator< (const Quantity &quantity) const |
Check if the quantity is less than a quantity. More... | |
bool | operator== (const Quantity &quantity) const |
Check if the quantity is equal to a quantity. More... | |
Private Attributes | |
value_type | value |
Quantity value. | |
unit_type | unit |
Quantity unit. | |
A quantity of a defined unit.
|
inline |
Construct a Quantity from a value and unit.
value | the quantity value. |
unit | the quantity unit. |
|
inline |
Copy construct a Quantity.
quantity | the quantity to copy. |
|
inline |
Get the unit for this quantity.
References ome::xml::model::primitives::Quantity< Unit, Value >::unit.
Referenced by ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsTemperature, Value >::operator()(), ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsFrequency, Value >::operator()(), ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsPower, Value >::operator()(), ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsElectricPotential, Value >::operator()(), ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsTime, Value >::operator()(), ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsPressure, Value >::operator()(), and ome::xml::model::primitives::QuantityConverter< ome::xml::model::enums::UnitsLength, Value >::operator()().
|
inline |
Get the value for this quantity.
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::operator<<().
|
inline |
Modulo of the quantity by a value.
value | the value to compute the modulus with. |
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Multiply the quantity by a value.
value | the value to multiply by. |
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Increment the quantity by one.
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Add a quantity to the quantity.
quantity | the quantity to add. |
References ome::xml::model::primitives::convert(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::operator=().
|
inline |
Decrement the quantity by one.
References ome::xml::model::primitives::Quantity< Unit, Value >::operator<(), ome::xml::model::primitives::Quantity< Unit, Value >::operator==(), and ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Subtract a quantity from the quantity.
quantity | the quantity to subtract. |
References ome::xml::model::primitives::convert(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::operator=().
|
inline |
Divide the quantity by a value.
value | the value to divide by. |
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Check if the quantity is less than a quantity.
quantity | the quantity to compare with. |
References ome::xml::model::primitives::convert(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::operator--().
|
inline |
Assign the quantity from a quantity.
quantity | the quantity to assign. |
References ome::xml::model::primitives::Quantity< Unit, Value >::operator+=(), ome::xml::model::primitives::Quantity< Unit, Value >::operator-=(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Check if the quantity is equal to a quantity.
quantity | the quantity to compare with. |
References ome::xml::model::primitives::convert(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::operator--().