Open CASCADE Technology  7.1.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::Units_Measurement ( )

It is the empty constructor of the class.

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

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

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

Units_Measurement Units_Measurement::Divide ( const Units_Measurement ameasurement) const

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

Units_Measurement Units_Measurement::Divide ( const Standard_Real  avalue) const

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

void Units_Measurement::Dump ( ) const

Useful for debugging.

Units_Measurement Units_Measurement::Fractional ( ) const

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

Standard_Boolean Units_Measurement::HasToken ( ) const
Units_Measurement Units_Measurement::Integer ( ) const

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

Standard_Real Units_Measurement::Measurement ( ) const

Returns the value of the measurement.

Units_Measurement Units_Measurement::Multiply ( const Units_Measurement ameasurement) const

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

Units_Measurement Units_Measurement::Multiply ( const Standard_Real  avalue) const

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

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
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::Power ( const Standard_Real  anexponent) const

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

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

Handle< Units_Token > Units_Measurement::Token ( ) const

Returns the token contained in <me>.


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