Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
Units_ShiftedToken Class Reference

The ShiftedToken class inherits from Token and
describes tokens which have a gap in addition of
the multiplicative factor. This kind of token
allows the description of linear functions which
do not pass through the origin, of the form :

y = ax +b

where <x> and <y> are the unknown variables,
the mutiplicative factor, and the gap relative
to the ordinate axis.

An example is the tranlation between the Celsius
and Fahrenheit degree of temperature.
More...

#include <Units_ShiftedToken.hxx>

Inheritance diagram for Units_ShiftedToken:
Inheritance graph
[legend]

Public Member Functions

 Units_ShiftedToken (const Standard_CString aword, const Standard_CString amean, const Standard_Real avalue, const Standard_Real amove, const Handle< Units_Dimensions > &adimensions)
 Creates and returns a shifted token. <aword> is a
string containing the available word, <amean> gives
the signification of the token, <avalue> is the
numeric value of the dimension, <amove> is the gap,
and <adimensions> is the dimension of the given word
<aword>.
More...
 
virtual Handle_Units_Token Creates () const
 Creates and returns a token, which is a ShiftedToken.
More...
 
Standard_Real Move () const
 Returns the gap <themove>
More...
 
virtual Standard_Real Multiplied (const Standard_Real avalue) const
 This virtual method is called by the Measurement
methods, to compute the measurement during a
conversion.
More...
 
virtual Standard_Real Divided (const Standard_Real avalue) const
 This virtual method is called by the Measurement
methods, to compute the measurement during a
conversion.
More...
 
virtual void Destroy ()
 Destroies the Token
More...
 
 ~Units_ShiftedToken ()
 
virtual void Dump (const Standard_Integer ashift, const Standard_Integer alevel) const
 Useful for debugging
More...
 
- Public Member Functions inherited from Units_Token
 Units_Token ()
 Creates and returns a empty token.
More...
 
 Units_Token (const Standard_CString aword)
 Creates and returns a token. <aword> is a string
containing the available word.
More...
 
 Units_Token (const Handle< Units_Token > &atoken)
 Creates and returns a token. <atoken> is copied in
the returned token.
More...
 
 Units_Token (const Standard_CString aword, const Standard_CString amean)
 Creates and returns a token. <aword> is a string
containing the available word and <amean> gives the
signification of the token.
More...
 
 Units_Token (const Standard_CString aword, const Standard_CString amean, const Standard_Real avalue)
 Creates and returns a token. <aword> is a string
containing the available word, <amean> gives the
signification of the token and <avalue> is the numeric
value of the dimension.
More...
 
 Units_Token (const Standard_CString aword, const Standard_CString amean, const Standard_Real avalue, const Handle< Units_Dimensions > &adimension)
 Creates and returns a token. <aword> is a string
containing the available word, <amean> gives the
signification of the token, <avalue> is the numeric
value of the dimension, and <adimensions> is the
dimension of the given word <aword>.
More...
 
Standard_Integer Length () const
 Returns the length of the word.
More...
 
TCollection_AsciiString Word () const
 Returns the string <theword>
More...
 
void Word (const Standard_CString aword)
 Sets the field <theword> to <aword>.
More...
 
TCollection_AsciiString Mean () const
 Returns the significance of the word <theword>, which
is in the field <themean>.
More...
 
void Mean (const Standard_CString amean)
 Sets the field <themean> to <amean>.
More...
 
Standard_Real Value () const
 Returns the value stored in the field <thevalue>.
More...
 
void Value (const Standard_Real avalue)
 Sets the field <thevalue> to <avalue>.
More...
 
Handle_Units_Dimensions Dimensions () const
 Returns the dimensions of the token <thedimensions>.
More...
 
void Dimensions (const Handle< Units_Dimensions > &adimensions)
 Sets the field <thedimensions> to <adimensions>.
More...
 
void Update (const Standard_CString amean)
 
 Updates     the  token  <me>    with  the   additional <br>
     signification  <amean> by  concatenation   of the  two <br>
     strings   <themean>    and   <amean>.   If    the  two <br>
     significations are  the same  , an information message <br>
     is written in the output device. <br>


More...

 
Handle_Units_Token Add (const Standard_Integer aninteger) const
 
Handle_Units_Token Add (const Handle< Units_Token > &atoken) const
 Returns a token which is the addition of <me> and
another token <atoken>. The addition is possible if
and only if the dimensions are the same.
More...
 
Handle_Units_Token Subtract (const Handle< Units_Token > &atoken) const
 Returns a token which is the subtraction of <me> and
another token <atoken>. The subtraction is possible if
and only if the dimensions are the same.
More...
 
Handle_Units_Token Multiply (const Handle< Units_Token > &atoken) const
 Returns a token which is the product of <me> and
another token <atoken>.
More...
 
Handle_Units_Token Divide (const Handle< Units_Token > &atoken) const
 Returns a token which is the division of <me> by another
token <atoken>.
More...
 
Handle_Units_Token Power (const Handle< Units_Token > &atoken) const
 Returns a token which is <me> to the power of another
token <atoken>. The computation is possible only if
<atoken> is a dimensionless constant.
More...
 
Handle_Units_Token Power (const Standard_Real anexponent) const
 Returns a token which is <me> to the power of <anexponent>.
More...
 
Standard_Boolean IsEqual (const Standard_CString astring) const
 Returns true if the field <theword> and the string
<astring> are the same, false otherwise.
More...
 
Standard_Boolean IsEqual (const Handle< Units_Token > &atoken) const
 Returns true if the field <theword> and the string
<theword> contained in the token <atoken> are the
same, false otherwise.
More...
 
Standard_Boolean IsNotEqual (const Standard_CString astring) const
 Returns false if the field <theword> and the string
<astring> are the same, true otherwise.
More...
 
Standard_Boolean IsNotEqual (const Handle< Units_Token > &atoken) const
 Returns false if the field <theword> and the string
<theword> contained in the token <atoken> are the
same, true otherwise.
More...
 
Standard_Boolean IsLessOrEqual (const Standard_CString astring) const
 Returns true if the field <theword> is strictly
contained at the beginning of the string <astring>,
false otherwise.
More...
 
Standard_Boolean IsGreater (const Standard_CString astring) const
 Returns false if the field <theword> is strictly
contained at the beginning of the string <astring>,
true otherwise.
More...
 
Standard_Boolean IsGreater (const Handle< Units_Token > &atoken) const
 Returns false if the field <theword> is strictly
contained at the beginning of the string <astring>,
true otherwise.
More...
 
Standard_Boolean IsGreaterOrEqual (const Handle< Units_Token > &atoken) const
 Returns true if the string <astring> is strictly
contained at the beginning of the field <theword>
false otherwise.
More...
 
 ~Units_Token ()
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void ShallowDump (Standard_OStream &) const
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Detailed Description

The ShiftedToken class inherits from Token and
describes tokens which have a gap in addition of
the multiplicative factor. This kind of token
allows the description of linear functions which
do not pass through the origin, of the form :

y = ax +b

where <x> and <y> are the unknown variables,
the mutiplicative factor, and the gap relative
to the ordinate axis.

An example is the tranlation between the Celsius
and Fahrenheit degree of temperature.

Constructor & Destructor Documentation

Units_ShiftedToken::Units_ShiftedToken ( const Standard_CString  aword,
const Standard_CString  amean,
const Standard_Real  avalue,
const Standard_Real  amove,
const Handle< Units_Dimensions > &  adimensions 
)

Creates and returns a shifted token. <aword> is a
string containing the available word, <amean> gives
the signification of the token, <avalue> is the
numeric value of the dimension, <amove> is the gap,
and <adimensions> is the dimension of the given word
<aword>.

Units_ShiftedToken::~Units_ShiftedToken ( )
inline

Member Function Documentation

virtual Handle_Units_Token Units_ShiftedToken::Creates ( ) const
virtual

Creates and returns a token, which is a ShiftedToken.

Reimplemented from Units_Token.

virtual void Units_ShiftedToken::Destroy ( )
virtual

Destroies the Token

Reimplemented from Units_Token.

virtual Standard_Real Units_ShiftedToken::Divided ( const Standard_Real  avalue) const
virtual

This virtual method is called by the Measurement
methods, to compute the measurement during a
conversion.

Reimplemented from Units_Token.

virtual void Units_ShiftedToken::Dump ( const Standard_Integer  ashift,
const Standard_Integer  alevel 
) const
virtual

Useful for debugging

Reimplemented from Units_Token.

Standard_Real Units_ShiftedToken::Move ( ) const

Returns the gap <themove>

virtual Standard_Real Units_ShiftedToken::Multiplied ( const Standard_Real  avalue) const
virtual

This virtual method is called by the Measurement
methods, to compute the measurement during a
conversion.

Reimplemented from Units_Token.


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