Open CASCADE Technology 7.8.2.dev
Units_Measurement Class Reference

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

#include <Units_Measurement.hxx>

Public Member Functions

 Units_Measurement ()
 It is the empty constructor of the class.
 
 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.
 
 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.
 
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>.
 
Units_Measurement Integer () const
 Returns a Measurement object with the integer value of the measurement contained in <me>.
 
Units_Measurement Fractional () const
 Returns a Measurement object with the fractional value of the measurement contained in <me>.
 
Standard_Real Measurement () const
 Returns the value of the measurement.
 
Handle< Units_TokenToken () const
 Returns the token contained in <me>.
 
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
 
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
 
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
 
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
 
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
 
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
 
Units_Measurement Power (const Standard_Real anexponent) const
 Returns a measurement which is <me> powered <anexponent>.
 
Standard_Boolean HasToken () const
 
void Dump () const
 Useful for debugging.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Units_Measurement() [1/3]

Units_Measurement::Units_Measurement ( )

It is the empty constructor of the class.

◆ Units_Measurement() [2/3]

Units_Measurement::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.

◆ Units_Measurement() [3/3]

Units_Measurement::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.

Member Function Documentation

◆ Add()

Units_Measurement 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>.

◆ Convert()

void Units_Measurement::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>.

◆ Divide() [1/2]

Units_Measurement Units_Measurement::Divide ( const Standard_Real avalue) const

Returns a measurement which is the division of <me> by the constant <avalue>.

◆ Divide() [2/2]

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

Returns a measurement which is the division of <me> by <ameasurement>.

◆ Dump()

void Units_Measurement::Dump ( ) const

Useful for debugging.

◆ Fractional()

Units_Measurement Units_Measurement::Fractional ( ) const

Returns a Measurement object with the fractional value of the measurement contained in <me>.

◆ HasToken()

Standard_Boolean Units_Measurement::HasToken ( ) const

◆ Integer()

Units_Measurement Units_Measurement::Integer ( ) const

Returns a Measurement object with the integer value of the measurement contained in <me>.

◆ Measurement()

Standard_Real Units_Measurement::Measurement ( ) const

Returns the value of the measurement.

◆ Multiply() [1/2]

Units_Measurement Units_Measurement::Multiply ( const Standard_Real avalue) const

Returns a measurement which is the multiplication of <me> with the value <avalue>.

◆ Multiply() [2/2]

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

Returns a measurement which is the multiplication of <me> and <ameasurement>.

◆ operator*() [1/2]

Units_Measurement Units_Measurement::operator* ( const Standard_Real avalue) const
inline

◆ operator*() [2/2]

Units_Measurement Units_Measurement::operator* ( const Units_Measurement & ameasurement) const
inline

◆ operator+()

Units_Measurement Units_Measurement::operator+ ( const Units_Measurement & ameasurement) const
inline

◆ operator-()

Units_Measurement Units_Measurement::operator- ( const Units_Measurement & ameasurement) const
inline

◆ operator/() [1/2]

Units_Measurement Units_Measurement::operator/ ( const Standard_Real avalue) const
inline

◆ operator/() [2/2]

Units_Measurement Units_Measurement::operator/ ( const Units_Measurement & ameasurement) const
inline

◆ Power()

Units_Measurement Units_Measurement::Power ( const Standard_Real anexponent) const

Returns a measurement which is <me> powered <anexponent>.

◆ Subtract()

Units_Measurement 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>.

◆ Token()

Handle< Units_Token > Units_Measurement::Token ( ) const

Returns the token contained in <me>.


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