# FoundationClasses
TKernel
Units

# Units_Measurement Class Reference

This class defines a measurement which is the
association of a real value and a unit.
.

`#include <Units_Measurement.hxx>`

## Public Member Functions

void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | Units_Measurement ()
| It is the empty constructor of the class. .
Standard_EXPORT | Units_Measurement (const Standard_Real avalue, const Handle(Units_Token)&atoken)
| Returns an instance of this class. <avalue> defines the measurement, and <atoken> the token which defines the unit used. .
Standard_EXPORT | Units_Measurement (const Standard_Real avalue, const Standard_CString aunit)
| Returns an instance of this class. <avalue> defines the measurement, and <aunit> the unit used, described in natural language. .
Standard_EXPORT void | Convert (const Standard_CString aunit)
| Converts (if possible) the measurement object into another unit. <aunit> must have the same dimensionality as the unit contained in the token <thetoken>. .
Standard_EXPORT Units_Measurement | Integer () const
| Returns a Measurement object with the integer value of the measurement contained in <me>. .
Standard_EXPORT Units_Measurement | Fractional () const
| Returns a Measurement object with the fractional value of the measurement contained in <me>. .
Standard_EXPORT Standard_Real | Measurement () const
| Returns the value of the measurement. .
Standard_EXPORT Handle_Units_Token | Token () const
| Returns the token contained in <me>. .
Standard_EXPORT Units_Measurement | Add (const Units_Measurement &ameasurement) const
| Returns (if it is possible) a measurement which is the addition of <me> and <ameasurement>. The chosen returned unit is the unit of <me>. .
Units_Measurement | operator+ (const Units_Measurement &ameasurement) const
Standard_EXPORT Units_Measurement | Subtract (const Units_Measurement &ameasurement) const
| Returns (if it is possible) a measurement which is the subtraction of <me> and <ameasurement>. The chosen returned unit is the unit of <me>. .
Units_Measurement | operator- (const Units_Measurement &ameasurement) const
Standard_EXPORT Units_Measurement | Multiply (const Units_Measurement &ameasurement) const
| Returns a measurement which is the multiplication of <me> and <ameasurement>. .
Units_Measurement | operator * (const Units_Measurement &ameasurement) const
Standard_EXPORT Units_Measurement | Multiply (const Standard_Real avalue) const
| Returns a measurement which is the multiplication of <me> with the value <avalue>. .
Units_Measurement | operator * (const Standard_Real avalue) const
Standard_EXPORT Units_Measurement | Divide (const Units_Measurement &ameasurement) const
| Returns a measurement which is the division of <me> by <ameasurement>. .
Units_Measurement | operator/ (const Units_Measurement &ameasurement) const
Standard_EXPORT Units_Measurement | Divide (const Standard_Real avalue) const
| Returns a measurement which is the division of <me> by the constant <avalue>. .
Units_Measurement | operator/ (const Standard_Real avalue) const
Standard_EXPORT Units_Measurement | Power (const Standard_Real anexponent) const
| Returns a measurement which is <me> powered <anexponent>. .
Standard_EXPORT Standard_Boolean | HasToken () const
Standard_EXPORT void | Dump () const
| Useful for debugging. .

## Private Attributes

Standard_Real | themeasurement
Handle_Units_Token | thetoken
Standard_Boolean | myHasToken

## Constructor & Destructor Documentation

Standard_EXPORT Units_Measurement::Units_Measurement | ( |  | ) |

Standard_EXPORT Units_Measurement::Units_Measurement | ( | const Standard_Real | avalue,
|  | const Handle(Units_Token)& | atoken
| ) |

Standard_EXPORT Units_Measurement::Units_Measurement | ( | const Standard_Real | avalue,
|  | const Standard_CString | aunit
| ) |

## Member Function Documentation

Standard_EXPORT Units_Measurement Units_Measurement::Add | ( | const Units_Measurement & | ameasurement | ) | const

Standard_EXPORT void Units_Measurement::Convert | ( | const Standard_CString | aunit | ) |

Standard_EXPORT Units_Measurement Units_Measurement::Divide | ( | const Standard_Real | avalue | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Divide | ( | const Units_Measurement & | ameasurement | ) | const

Standard_EXPORT void Units_Measurement::Dump | ( |  | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Fractional | ( |  | ) | const

Standard_EXPORT Standard_Boolean Units_Measurement::HasToken | ( |  | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Integer | ( |  | ) | const

Standard_EXPORT Standard_Real Units_Measurement::Measurement | ( |  | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Multiply | ( | const Standard_Real | avalue | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Multiply | ( | const Units_Measurement & | ameasurement | ) | const

Units_Measurement Units_Measurement::operator * | ( | const Standard_Real | avalue | ) | const`[inline]`

Units_Measurement Units_Measurement::operator * | ( | const Units_Measurement & | ameasurement | ) | const`[inline]`

void Units_Measurement::operator delete | ( | void * | anAddress | ) | `[inline]`

void* Units_Measurement::operator new | ( | size_t | size | ) | `[inline]`

void* Units_Measurement::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Units_Measurement Units_Measurement::operator+ | ( | const Units_Measurement & | ameasurement | ) | const`[inline]`

Units_Measurement Units_Measurement::operator- | ( | const Units_Measurement & | ameasurement | ) | const`[inline]`

Units_Measurement Units_Measurement::operator/ | ( | const Standard_Real | avalue | ) | const`[inline]`

Units_Measurement Units_Measurement::operator/ | ( | const Units_Measurement & | ameasurement | ) | const`[inline]`

Standard_EXPORT Units_Measurement Units_Measurement::Power | ( | const Standard_Real | anexponent | ) | const

Standard_EXPORT Units_Measurement Units_Measurement::Subtract | ( | const Units_Measurement & | ameasurement | ) | const

Standard_EXPORT Handle_Units_Token Units_Measurement::Token | ( |  | ) | const

## Field Documentation

Standard_Boolean Units_Measurement::myHasToken `[private]`

Standard_Real Units_Measurement::themeasurement `[private]`

Handle_Units_Token Units_Measurement::thetoken `[private]`

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

- Units_Measurement.hxx