#include <ulength.h>
get scale factor. | ||||
Get scale factor to convert from the actual unit into the SI-base unit meter. The multiplication of the length by the scale results to the equivalent length in meter.
| ||||
ecode | _code | |||
code | ||||
double | _scale | |||
scale factor | ||||
static const int | _map_size = 12 | |||
map size | ||||
static map_t | _map [] | |||
map | ||||
static double | scale (int code) | |||
Public Types | ||||
enum | ecode { UNKNOWN, KILOMETRE, METRE, CENTIMETRE, MILLIMETRE, MICROMETRE, MILE, MILES_US, INCH, FEET, YARD, NAUTICAL_MILE } | |||
code of length More... | ||||
Public Member Functions | ||||
set unit using symbol-string. | ||||
| ||||
bool | set (const char *symbol) | |||
UnitLength () | ||||
default constructor | ||||
constructor using symbol-string. | ||||
| ||||
UnitLength (const char *symbol) | ||||
virtual | ~UnitLength () | |||
destructor | ||||
get scale factor. | ||||
| ||||
double | scale () const | |||
get symbol-string. | ||||
| ||||
const char * | symbol () const | |||
Static Public Member Functions | ||||
get code. | ||||
| ||||
static ecode | code (const char *symbol) | |||
get name. | ||||
| ||||
static const char * | name (int code) | |||
get symbol. | ||||
| ||||
static const char * | symbol (int code) | |||
Classes | ||||
struct | map_t | |||
map structure More... |
Measurements of length.
UnitLength::map_t GenLib2::UnitLength::_map [static, protected] |
Initial value:
{ { UNKNOWN, "unk", "unkown", 0. }, { KILOMETRE, "km", "kilometre", 1e+3 }, { METRE, "m", "metre", 1. }, { CENTIMETRE, "cm", "centimetre", 1e-2 }, { MILLIMETRE, "mm", "millimetre", 1e-3 }, { MICROMETRE, "um", "micrometre", 1e-6 }, { MILE, "mi", "intern. mile", 1609.344 }, { MILES_US, "miUS", "US state mile", 1609.32721869 }, { INCH, "in", "inch", 0.0254 }, { FEET, "ft", "feet", 0.3048 }, { YARD, "yd", "yard", 0.9144 }, { NAUTICAL_MILE, "n.m.", "nautical mile", 1852. } }