Inheritance diagram for code::W2Unit:

lakshman
Charles Kerr
Public Member Functions | |
| W2Unit () | |
| W2Unit (double v, const std::string &s) | |
| Build a W2Unit object given a value along with its unit name. | |
| 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 bool | isValidUnit (const std::string &unit) |
| static bool | isCompatibleUnit (const std::string &from, const std::string &to) |
| static double | value (const std::string &from, const std::string &to, double fromValue) |
| Convert a value from one unit to another. | |
| 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 |
Classes | |
| struct | UnitConverter |
| Store slope and intercept used by W2Unit. More... | |
| code::W2Unit::W2Unit | ( | ) | [inline] |
| code::W2Unit::W2Unit | ( | double | v, | |
| const std::string & | s | |||
| ) | [inline] |
Build a W2Unit 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] |
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] |
Get a UnitConverter that converts from one unit to another.
| static bool code::W2Unit::isCompatibleUnit | ( | const std::string & | from, | |
| const std::string & | to | |||
| ) | [static] |
| static bool code::W2Unit::isValidUnit | ( | const std::string & | unit | ) | [static] |
| std::string code::W2Unit::unit | ( | ) | const [inline] |
Return this W2Unit's units.
| double code::W2Unit::value | ( | ) | const [inline] |
Return this W2Unit's value in its native units.
| bool code::W2Unit::value | ( | const std::string & | units, | |
| double & | setme | |||
| ) | const [inline] |
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] |
Return this W2Unit's value in "units" units.
| static double code::W2Unit::value | ( | const std::string & | from, | |
| const std::string & | to, | |||
| double | fromValue | |||
| ) | [static] |
| static double code::W2Unit::value | ( | const UnitConverter & | uc, | |
| double | d | |||
| ) | [inline, static] |
Convert a value using a UnitConverter.
const std::string code::W2Unit::Degrees [static] |
const std::string code::W2Unit::Dimensionless [static] |
const std::string code::W2Unit::Kilometers [static] |
const std::string code::W2Unit::MetersPerSecond [static] |
const std::string code::W2Unit::Seconds [static] |
1.4.7