code::Length Class Reference

List of all members.

Detailed Description

Representation of a physical length (distance).

Author:
Lulin Song (original)
Author
lakshman
Date
2009/06/02 20:17:38
See also:
Speed


Public Member Functions

 Length ()
 The default Length is zero.
 Length (double value, const std::string &unit)
 Build a Length object given a string as its unit.
double value (const std::string &unitStr)
double centimeters () const
 Return cenimeters.
double meters () const
 Return meters.
double kilometers () const
 Return kilometers.
double kiloFeet () const
 Return kilofeet.
double feet () const
 Return feet.
double inches () const
 Return inches.
double nauticalMiles () const
 Return nautical miles.
double statuteMiles () const
 Return statute miles.
double degreesOfLatitude () const
 Return degrees of latitude.
Lengthoperator+= (const Length &l)
Lengthoperator-= (const Length &l)
Lengthoperator *= (double d)
Lengthoperator/= (double d)
Length operator+ (const Length &l) const
Length operator- (const Length &l) const
Length operator * (double d) const
Length operator/ (double d) const
double operator/ (const Length &l) const
int compareTo (const Length &l) const
bool operator< (const Length &l) const
bool operator<= (const Length &l) const
bool operator== (const Length &l) const
bool operator!= (const Length &l) const
bool operator>= (const Length &l) const
bool operator> (const Length &l) const

Static Public Member Functions

static Length Kilometers (double km)
 Interpret double as kilometers.
static Length Meters (double m)
 Interpret double as meters.
static Length Centimeters (double cm)
 Interpret double as centimeters.
static Length Feet (double f)
 Interpret double as feet.
static Length Kilofeet (double kft)
 Interpret double as kilofeet.
static Length Inches (double in)
 Interpret double as inches.
static Length NauticalMiles (double nm)
 Interpret double as nautical miles.
static Length StatuteMiles (double sm)
 Interpret double as statute miles.

Friends

std::ostream & operator<< (std::ostream &, const Length &)
 Provide nice, printed output.
Length operator- (const Length &a)
 Negation operator.
const Lengthoperator+ (const Length &a)
 Unary +.
Length operator * (double scale, const Length &a)
 left scalar multiplication.


Constructor & Destructor Documentation

code::Length::Length (  )  [inline]

The default Length is zero.

code::Length::Length ( double  value,
const std::string &  unit 
)

Build a Length object given a string as its unit.


Member Function Documentation

double code::Length::centimeters (  )  const [inline]

Return cenimeters.

static Length code::Length::Centimeters ( double  cm  )  [inline, static]

Interpret double as centimeters.

int code::Length::compareTo ( const Length l  )  const [inline]

double code::Length::degreesOfLatitude (  )  const [inline]

Return degrees of latitude.

double code::Length::feet (  )  const [inline]

Return feet.

static Length code::Length::Feet ( double  f  )  [inline, static]

Interpret double as feet.

double code::Length::inches (  )  const [inline]

Return inches.

static Length code::Length::Inches ( double  in  )  [inline, static]

Interpret double as inches.

double code::Length::kiloFeet (  )  const [inline]

Return kilofeet.

static Length code::Length::Kilofeet ( double  kft  )  [inline, static]

Interpret double as kilofeet.

double code::Length::kilometers (  )  const [inline]

Return kilometers.

static Length code::Length::Kilometers ( double  km  )  [inline, static]

Interpret double as kilometers.

double code::Length::meters (  )  const [inline]

Return meters.

static Length code::Length::Meters ( double  m  )  [inline, static]

Interpret double as meters.

double code::Length::nauticalMiles (  )  const [inline]

Return nautical miles.

static Length code::Length::NauticalMiles ( double  nm  )  [inline, static]

Interpret double as nautical miles.

Length code::Length::operator * ( double  d  )  const [inline]

Length& code::Length::operator *= ( double  d  )  [inline]

bool code::Length::operator!= ( const Length l  )  const [inline]

Length code::Length::operator+ ( const Length l  )  const [inline]

Length& code::Length::operator+= ( const Length l  )  [inline]

Length code::Length::operator- ( const Length l  )  const [inline]

Length& code::Length::operator-= ( const Length l  )  [inline]

double code::Length::operator/ ( const Length l  )  const [inline]

Length code::Length::operator/ ( double  d  )  const [inline]

Length& code::Length::operator/= ( double  d  )  [inline]

bool code::Length::operator< ( const Length l  )  const [inline]

bool code::Length::operator<= ( const Length l  )  const [inline]

bool code::Length::operator== ( const Length l  )  const [inline]

bool code::Length::operator> ( const Length l  )  const [inline]

bool code::Length::operator>= ( const Length l  )  const [inline]

double code::Length::statuteMiles (  )  const [inline]

Return statute miles.

static Length code::Length::StatuteMiles ( double  sm  )  [inline, static]

Interpret double as statute miles.

double code::Length::value ( const std::string &  unitStr  ) 


Friends And Related Function Documentation

Length operator * ( double  scale,
const Length a 
) [friend]

left scalar multiplication.

const Length& operator+ ( const Length a  )  [friend]

Unary +.

Length operator- ( const Length a  )  [friend]

Negation operator.

std::ostream& operator<< ( std::ostream &  ,
const Length  
) [friend]

Provide nice, printed output.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7