roo_quantity
API Documentation for roo_quantity
Loading...
Searching...
No Matches
roo_quantity::Length Class Reference

Representation of length, internally stored as floating-point meters. More...

#include <length.h>

Public Member Functions

 Length ()
 Creates a length object representing an 'unknown' length.
 
float inKilometers () const
 Returns the length in kilometers.
 
float inMeters () const
 Returns the length in meters.
 
float inDecimeters () const
 Returns the length in decimeters.
 
float inCentimeters () const
 Returns the length in centimeters.
 
float inMillimeters () const
 Returns the length in millimeters.
 
float inMicrometers () const
 Returns the length in micrometers.
 
float inNanometers () const
 Returns the length in nanometers.
 
float inInches () const
 Returns the length in inches.
 
float inFeet () const
 Returns the length in feet.
 
float inYards () const
 Returns the length in yards.
 
float inLightYears () const
 Returns the length in light years.
 
bool isUnknown () const
 Returns whether the object represents an unknown length.
 
bool operator< (const Length &other) const
 
bool operator== (const Length &other) const
 
bool operator> (const Length &other) const
 
bool operator<= (const Length &other) const
 
bool operator>= (const Length &other) const
 
bool operator!= (const Length &other) const
 
Lengthoperator+= (const Length &other)
 
Lengthoperator-= (const Length &other)
 
Lengthoperator*= (float multi)
 
Lengthoperator/= (float div)
 

Friends

Length UnknownLength ()
 Returns a length object representing an unknown length.
 
Length LengthInMeters (float)
 Returns a length object equivalent to the specified length expressed in meters.
 

Detailed Description

Representation of length, internally stored as floating-point meters.

Definition at line 19 of file length.h.

Constructor & Destructor Documentation

◆ Length()

roo_quantity::Length::Length ( )
inline

Creates a length object representing an 'unknown' length.

Definition at line 22 of file length.h.

Member Function Documentation

◆ inCentimeters()

float roo_quantity::Length::inCentimeters ( ) const
inline

Returns the length in centimeters.

Definition at line 34 of file length.h.

◆ inDecimeters()

float roo_quantity::Length::inDecimeters ( ) const
inline

Returns the length in decimeters.

Definition at line 31 of file length.h.

◆ inFeet()

float roo_quantity::Length::inFeet ( ) const
inline

Returns the length in feet.

Definition at line 49 of file length.h.

◆ inInches()

float roo_quantity::Length::inInches ( ) const
inline

Returns the length in inches.

Definition at line 46 of file length.h.

◆ inKilometers()

float roo_quantity::Length::inKilometers ( ) const
inline

Returns the length in kilometers.

Definition at line 25 of file length.h.

◆ inLightYears()

float roo_quantity::Length::inLightYears ( ) const
inline

Returns the length in light years.

Definition at line 55 of file length.h.

◆ inMeters()

◆ inMicrometers()

float roo_quantity::Length::inMicrometers ( ) const
inline

Returns the length in micrometers.

Definition at line 40 of file length.h.

◆ inMillimeters()

float roo_quantity::Length::inMillimeters ( ) const
inline

Returns the length in millimeters.

Definition at line 37 of file length.h.

◆ inNanometers()

float roo_quantity::Length::inNanometers ( ) const
inline

Returns the length in nanometers.

Definition at line 43 of file length.h.

◆ inYards()

float roo_quantity::Length::inYards ( ) const
inline

Returns the length in yards.

Definition at line 52 of file length.h.

◆ isUnknown()

bool roo_quantity::Length::isUnknown ( ) const
inline

Returns whether the object represents an unknown length.

Definition at line 58 of file length.h.

◆ operator!=()

bool roo_quantity::Length::operator!= ( const Length other) const
inline

Definition at line 76 of file length.h.

◆ operator*=()

Length & roo_quantity::Length::operator*= ( float  multi)
inline

Definition at line 90 of file length.h.

◆ operator+=()

Length & roo_quantity::Length::operator+= ( const Length other)
inline

Definition at line 80 of file length.h.

References inMeters().

◆ operator-=()

Length & roo_quantity::Length::operator-= ( const Length other)
inline

Definition at line 85 of file length.h.

References inMeters().

◆ operator/=()

Length & roo_quantity::Length::operator/= ( float  div)
inline

Definition at line 95 of file length.h.

◆ operator<()

bool roo_quantity::Length::operator< ( const Length other) const
inline

Definition at line 60 of file length.h.

◆ operator<=()

bool roo_quantity::Length::operator<= ( const Length other) const
inline

Definition at line 68 of file length.h.

◆ operator==()

bool roo_quantity::Length::operator== ( const Length other) const
inline

Definition at line 62 of file length.h.

◆ operator>()

bool roo_quantity::Length::operator> ( const Length other) const
inline

Definition at line 66 of file length.h.

◆ operator>=()

bool roo_quantity::Length::operator>= ( const Length other) const
inline

Definition at line 72 of file length.h.

Friends And Related Symbol Documentation

◆ LengthInMeters

Length LengthInMeters ( float  length)
friend

Returns a length object equivalent to the specified length expressed in meters.

Definition at line 133 of file length.h.

◆ UnknownLength

Length UnknownLength ( )
friend

Returns a length object representing an unknown length.

Definition at line 123 of file length.h.


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