-- File: Units_Measurement.cdl -- Created: Mon Jun 22 16:42:01 1992 -- Author: Gilles DEBARBOUILLE -- ---Copyright: Matra Datavision 1992 class Measurement from Units ---Purpose: This class defines a measurement which is the -- association of a real value and a unit. uses Token from Units --raises is Create returns Measurement from Units; ---Level: Internal ---Purpose: It is the empty constructor of the class. Create(avalue : Real ; atoken : Token from Units) ---Level: Internal ---Purpose: Returns an instance of this class. defines -- the measurement, and the token which defines -- the unit used. returns Measurement from Units; Create(avalue : Real ; aunit : CString) ---Level: Public ---Purpose: Returns an instance of this class. defines -- the measurement, and the unit used, -- described in natural language. returns Measurement from Units; Convert(me : in out ; aunit : CString) ---Level: Public ---Purpose: Converts (if possible) the measurement object into -- another unit. must have the same -- dimensionality as the unit contained in the token -- . is static; Integer(me) returns Measurement from Units ---Level: Public ---Purpose: Returns a Measurement object with the integer value of -- the measurement contained in . is static; Fractional(me) returns Measurement from Units ---Level: Public ---Purpose: Returns a Measurement object with the fractional value -- of the measurement contained in . is static; Measurement(me) returns Real ---Level: Public ---Purpose: Returns the value of the measurement. is static; Token(me) returns Token from Units ---Level: Internal ---Purpose: Returns the token contained in . is static; Add(me ; ameasurement : Measurement from Units) returns Measurement from Units ---Level: Public ---C++: alias operator + ---Purpose: Returns (if it is possible) a measurement which is the -- addition of and . The chosen -- returned unit is the unit of . is static; Subtract(me ; ameasurement : Measurement from Units) returns Measurement from Units ---Level: Public ---C++: alias operator - ---Purpose: Returns (if it is possible) a measurement which is the -- subtraction of and . The chosen -- returned unit is the unit of . is static; Multiply(me ; ameasurement : Measurement from Units) returns Measurement from Units ---Level: Public ---C++: alias operator * ---Purpose: Returns a measurement which is the multiplication of -- and . is static; Multiply(me ; avalue : Real) returns Measurement from Units ---Level: Public ---C++: alias operator * ---Purpose: Returns a measurement which is the multiplication of -- with the value . is static; Divide(me ; ameasurement : Measurement from Units) returns Measurement from Units ---Level: Public ---C++: alias operator / ---Purpose: Returns a measurement which is the division of by -- . is static; Divide(me ; avalue : Real) returns Measurement from Units ---Level: Public ---C++: alias operator / ---Purpose: Returns a measurement which is the division of by -- the constant . is static; Power(me ; anexponent : Real) returns Measurement from Units ---Level: Public -- -C++: alias "friend Units_Measurement pow(const Units_Measurement&,const Standard_Real);" ---Purpose: Returns a measurement which is powered -- . is static; HasToken(me) returns Boolean from Standard; Dump(me) ---Level: Internal ---Purpose: Useful for debugging. is static; fields themeasurement : Real; thetoken : Token from Units; myHasToken : Boolean from Standard; end Measurement;