#include <Units.h>
Public Member Functions | |
Units () | |
Units (const Units &rhs) | |
Units & | operator= (const Units &rhs) |
virtual | ~Units () |
void | convert (const std::string &from, const std::string &to, double &slope, double &offset) throw (UnitException) |
bool | areConvertible (const std::string &unit1, const std::string &unit2) const throw (UnitException) |
test if two units are convertible to each others | |
bool | isTime (const std::string &timeUnit) const throw (UnitException) |
MetNoFimex::Units::Units | ( | ) |
initialization of unit handling, i.e. parsing of unit file etc if required
MetNoFimex::Units::Units | ( | const Units & | rhs | ) |
virtual MetNoFimex::Units::~Units | ( | ) | [virtual] |
void MetNoFimex::Units::convert | ( | const std::string & | from, | |
const std::string & | to, | |||
double & | slope, | |||
double & | offset | |||
) | throw (UnitException) |
calculate the linear unit conversion: newVal (in to unit) = oldVal (in from unit) * slope + offset
from | unit | |
to | unit | |
slope | return value of the slope | |
offset | return value of the offset |
bool MetNoFimex::Units::areConvertible | ( | const std::string & | unit1, | |
const std::string & | unit2 | |||
) | const throw (UnitException) |
test if two units are convertible to each others
unit1 | first unit | |
unit2 | second unit |
bool MetNoFimex::Units::isTime | ( | const std::string & | timeUnit | ) | const throw (UnitException) |