Open CASCADE Technology  7.5.0.beta
Public Member Functions
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. More...
 
 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. More...
 
 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. More...
 
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>. More...
 
Units_Measurement Integer () const
 Returns a Measurement object with the integer value of the measurement contained in <me>. More...
 
Units_Measurement Fractional () const
 Returns a Measurement object with the fractional value of the measurement contained in <me>. More...
 
Standard_Real Measurement () const
 Returns the value of the measurement. More...
 
Handle< Units_TokenToken () const
 Returns the token contained in <me>. More...
 
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>. More...
 
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>. More...
 
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>. More...
 
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>. More...
 
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>. More...
 
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>. More...
 
Units_Measurement operator/ (const Standard_Real avalue) const
 
Units_Measurement Power (const Standard_Real anexponent) const
 Returns a measurement which is <me> powered <anexponent>. More...
 
Standard_Boolean HasToken () const
 
void Dump () const
 Useful for debugging. More...
 

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 Units_Measurement ameasurement) const

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

◆ Divide() [2/2]

Units_Measurement Units_Measurement::Divide ( const Standard_Real  avalue) const

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

◆ 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 Units_Measurement ameasurement) const

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

◆ Multiply() [2/2]

Units_Measurement Units_Measurement::Multiply ( const Standard_Real  avalue) const

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

◆ operator*() [1/2]

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

◆ operator*() [2/2]

Units_Measurement Units_Measurement::operator* ( const Standard_Real  avalue) 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 Units_Measurement ameasurement) const
inline

◆ operator/() [2/2]

Units_Measurement Units_Measurement::operator/ ( const Standard_Real  avalue) 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: