GenLib2::UnitLength Class Reference

Unit length class. More...

#include <ulength.h>

List of all members.

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.

Parameters:
code 
Returns:
scale factor


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.
Parameters:
symbol 
Returns:
true = OK, false = error occured


bool set (const char *symbol)
 UnitLength ()
 default constructor
constructor using symbol-string.
Parameters:
symbol 


 UnitLength (const char *symbol)
virtual ~UnitLength ()
 destructor
get scale factor.
Returns:
scale factor


double scale () const
get symbol-string.
Returns:
symbol


const char * symbol () const

Static Public Member Functions

get code.
Parameters:
symbol 
Returns:
code


static ecode code (const char *symbol)
get name.
Parameters:
code 
Returns:
name


static const char * name (int code)
get symbol.
Parameters:
code 
Returns:
symbol


static const char * symbol (int code)

Classes

struct  map_t
 map structure More...


Detailed Description

Unit length class.

Measurements of length.

Author:
Dirk Stallmann

Member Enumeration Documentation

code of length

Enumerator:
UNKNOWN  unknown
KILOMETRE  kilometer
METRE  metre
CENTIMETRE  centimeter
MILLIMETRE  millimetre
MICROMETRE  micrometre
MILE  international mile
MILES_US  US state mile.
INCH  inch
FEET  feet
YARD  yard
NAUTICAL_MILE  nautical mile


Member Data Documentation

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. } 
}
map


The documentation for this class was generated from the following files:

Generated on Wed Aug 6 15:46:44 2008 by  doxygen 1.5.5