#include <UnitVariable.h>
Public Methods | |
UnitVariable (T val, const Unit &) | |
Constructor. Pass in the value plus the Unit. | |
UnitVariable (T val) | |
Construct variable with no unit. | |
UnitVariable (T val, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
UnitVariable (T val, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &, const SIBaseUnit &) | |
virtual | ~UnitVariable () |
T | getValue () const |
Return the value of the object stored. The value will be given in the SI Base Units without any prefix (m,kg,s,A,K,mol,cl). | |
double | getConversionFactor (const SIBaseUnit &) const |
return a conversion factor that can be used to convert the value given by getValue() to the unit/s passed in as arguments. The function will throw an exception of type UnitConversionError if the units requested are incompatible with the units stored for the object. | |
double | getConversionFactor (const SIBaseUnit &,const SIBaseUnit &) const |
double | getConversionFactor (const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &) const |
double | getConversionFactor (const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &,const SIBaseUnit &) const |
double | getConversionFactor (const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &) const |
double | getConversionFactor (const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &,const SIBaseUnit &, const SIBaseUnit &,const SIBaseUnit &) const |
Unit | getUnit () const |
void | DumpDiagnostics () const |
DumpDiagnostics() dumps the object's state to standard output. |
To be able to return a value in a different unit than the SI base unit the function double getConversionFactor(...) is defined. It will take as the argument a number of SIBaseUnits with prefixes and will then return the factor with which the values of the stored object need to be multiplied to obtain the results in the requested unit. Note that there is a template specialization for pointers.