Inheritance diagram for code::DynDimVal:
Out dated Class. Recomended not too use it in the future. Use W2Unit whenever you need to do unit converion.
Public Member Functions | |
DynDimVal () | |
DynDimVal (double value, const std::string &) | |
Build an DynDimVal object given a value along with its unit name. | |
double | num (const std::string &unitStr) const |
Return double value with passed in unit string. | |
std::string | str () const |
Return unit string. | |
double | value (const std::string &units) const |
Return this W2Unit's value in "units" units. | |
bool | value (const std::string &units, double &setme) const |
Convert the current W2Unit's value into other units. | |
double | value () const |
Return this W2Unit's value in its native units. | |
std::string | unit () const |
Return this W2Unit's units. | |
Static Public Member Functions | |
static bool | getConverter (const std::string &from, const std::string &to, UnitConverter &setme) |
Get a UnitConverter that converts from one unit to another. | |
static double | value (const UnitConverter &uc, double d) |
Convert a value using a UnitConverter. | |
static double | value (const std::string &from, const std::string &to, double fromValue) |
Convert a value from one unit to another. | |
static bool | isValidUnit (const std::string &unit) |
static bool | isCompatibleUnit (const std::string &from, const std::string &to) |
static bool | convert (const std::string &from, const std::string &to, double fromValue, double &setmeToValue) |
Convert a value from one unit to another. | |
Static Public Attributes | |
static const std::string | Dimensionless |
static const std::string | Kilometers |
static const std::string | MetersPerSecond |
static const std::string | Degrees |
static const std::string | Seconds |
code::DynDimVal::DynDimVal | ( | ) |
code::DynDimVal::DynDimVal | ( | double | value, | |
const std::string & | ||||
) |
Build an DynDimVal object given a value along with its unit name.
static bool code::W2Unit::convert | ( | const std::string & | from, | |
const std::string & | to, | |||
double | fromValue, | |||
double & | setmeToValue | |||
) | [static, inherited] |
Convert a value from one unit to another.
Like value(), but returns a success flag to let callers know whether or not the conversion was successful.
static bool code::W2Unit::getConverter | ( | const std::string & | from, | |
const std::string & | to, | |||
UnitConverter & | setme | |||
) | [static, inherited] |
Get a UnitConverter that converts from one unit to another.
static bool code::W2Unit::isCompatibleUnit | ( | const std::string & | from, | |
const std::string & | to | |||
) | [static, inherited] |
static bool code::W2Unit::isValidUnit | ( | const std::string & | unit | ) | [static, inherited] |
double code::DynDimVal::num | ( | const std::string & | unitStr | ) | const |
Return double value with passed in unit string.
std::string code::DynDimVal::str | ( | ) | const |
Return unit string.
std::string code::W2Unit::unit | ( | ) | const [inline, inherited] |
Return this W2Unit's units.
double code::W2Unit::value | ( | ) | const [inline, inherited] |
Return this W2Unit's value in its native units.
bool code::W2Unit::value | ( | const std::string & | units, | |
double & | setme | |||
) | const [inline, inherited] |
Convert the current W2Unit's value into other units.
Like value(string), but returns a success flag to let callers know whether or not the conversion was successful.
double code::W2Unit::value | ( | const std::string & | units | ) | const [inline, inherited] |
Return this W2Unit's value in "units" units.
static double code::W2Unit::value | ( | const std::string & | from, | |
const std::string & | to, | |||
double | fromValue | |||
) | [static, inherited] |
static double code::W2Unit::value | ( | const UnitConverter & | uc, | |
double | d | |||
) | [inline, static, inherited] |
Convert a value using a UnitConverter.
const std::string code::W2Unit::Degrees [static, inherited] |
const std::string code::W2Unit::Dimensionless [static, inherited] |
const std::string code::W2Unit::Kilometers [static, inherited] |
const std::string code::W2Unit::MetersPerSecond [static, inherited] |
const std::string code::W2Unit::Seconds [static, inherited] |