ome-xml
5.2.0-m5
|
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 Member Functions | |
value_type | convert_value (const Quantity &quantity, unit_type unit) const |
Convert a quantity to a specific unit. 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. |
|
inlineprivate |
Convert a quantity to a specific unit.
quantity | the quantity to convert. |
unit | the unit to which to convert the quantity. |
References ome::xml::model::primitives::Quantity< Unit, Value >::getValue(), and ome::xml::model::primitives::Quantity< Unit, Value >::unit.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::operator+=(), ome::xml::model::primitives::Quantity< Unit, Value >::operator-=(), ome::xml::model::primitives::Quantity< Unit, Value >::operator<(), and ome::xml::model::primitives::Quantity< Unit, Value >::operator==().
|
inline |
Get the unit for this quantity.
References ome::xml::model::primitives::Quantity< Unit, Value >::unit.
|
inline |
Get the value for this quantity.
References ome::xml::model::primitives::Quantity< Unit, Value >::value.
Referenced by ome::xml::model::primitives::Quantity< Unit, Value >::convert_value(), and 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::Quantity< Unit, Value >::convert_value(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Decrement the quantity by one.
References 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::Quantity< Unit, Value >::convert_value(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
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::Quantity< Unit, Value >::convert_value(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.
|
inline |
Assign the quantity from a quantity.
quantity | the quantity to assign. |
References 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::Quantity< Unit, Value >::convert_value(), ome::xml::model::primitives::Quantity< Unit, Value >::unit, and ome::xml::model::primitives::Quantity< Unit, Value >::value.