Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Units_Token Class Reference

This class defines an elementary word contained in a Sentence object. More...

#include <Units_Token.hxx>

Inheritance diagram for Units_Token:
Inheritance graph
[legend]

Public Member Functions

 Units_Token ()
 Creates and returns a empty token.
 
 Units_Token (const char *const aword)
 Creates and returns a token. <aword> is a string containing the available word.
 
 Units_Token (const occ::handle< Units_Token > &atoken)
 Creates and returns a token. <atoken> is copied in the returned token.
 
 Units_Token (const char *const aword, const char *const amean)
 Creates and returns a token. <aword> is a string containing the available word and <amean> gives the signification of the token.
 
 Units_Token (const char *const aword, const char *const amean, const double 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.
 
 Units_Token (const char *const aword, const char *const amean, const double avalue, const occ::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>.
 
virtual occ::handle< Units_TokenCreates () const
 Creates and returns a token, which is a ShiftedToken.
 
int Length () const
 Returns the length of the word.
 
TCollection_AsciiString Word () const
 Returns the string <theword>
 
void Word (const char *const aword)
 Sets the field <theword> to <aword>.
 
TCollection_AsciiString Mean () const
 Returns the significance of the word <theword>, which is in the field <themean>.
 
void Mean (const char *const amean)
 Sets the field <themean> to <amean>.
 
double Value () const
 Returns the value stored in the field <thevalue>.
 
void Value (const double avalue)
 Sets the field <thevalue> to <avalue>.
 
occ::handle< Units_DimensionsDimensions () const
 Returns the dimensions of the token <thedimensions>.
 
void Dimensions (const occ::handle< Units_Dimensions > &adimensions)
 Sets the field <thedimensions> to <adimensions>.
 
void Update (const char *const amean)
 Updates the token <me> with the additional signification <amean> by concatenation of the two strings <themean> and <amean>. If the two significations are the same, an information message is written in the output device.
 
occ::handle< Units_TokenAdd (const int aninteger) const
 
occ::handle< Units_TokenAdd (const occ::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.
 
occ::handle< Units_TokenSubtract (const occ::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.
 
occ::handle< Units_TokenMultiply (const occ::handle< Units_Token > &atoken) const
 Returns a token which is the product of <me> and another token <atoken>.
 
virtual double Multiplied (const double avalue) const
 This virtual method is called by the Measurement methods, to compute the measurement during a conversion.
 
occ::handle< Units_TokenDivide (const occ::handle< Units_Token > &atoken) const
 Returns a token which is the division of <me> by another token <atoken>.
 
virtual double Divided (const double avalue) const
 This virtual method is called by the Measurement methods, to compute the measurement during a conversion.
 
occ::handle< Units_TokenPower (const occ::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.
 
occ::handle< Units_TokenPower (const double anexponent) const
 Returns a token which is <me> to the power of <anexponent>.
 
bool IsEqual (const char *const astring) const
 Returns true if the field <theword> and the string <astring> are the same, false otherwise.
 
bool IsEqual (const occ::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.
 
bool IsNotEqual (const char *const astring) const
 Returns false if the field <theword> and the string <astring> are the same, true otherwise.
 
bool IsNotEqual (const occ::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.
 
bool IsLessOrEqual (const char *const astring) const
 Returns true if the field <theword> is strictly contained at the beginning of the string <astring>, false otherwise.
 
bool IsGreater (const char *const astring) const
 Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.
 
bool IsGreater (const occ::handle< Units_Token > &atoken) const
 Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.
 
bool IsGreaterOrEqual (const occ::handle< Units_Token > &atoken) const
 Returns true if the string <astring> is strictly contained at the beginning of the field <theword> false otherwise.
 
virtual void Dump (const int ashift, const int alevel) const
 Useful for debugging.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

This class defines an elementary word contained in a Sentence object.

Constructor & Destructor Documentation

◆ Units_Token() [1/6]

Units_Token::Units_Token ( )

Creates and returns a empty token.

◆ Units_Token() [2/6]

Units_Token::Units_Token ( const char *const aword)

Creates and returns a token. <aword> is a string containing the available word.

◆ Units_Token() [3/6]

Units_Token::Units_Token ( const occ::handle< Units_Token > & atoken)

Creates and returns a token. <atoken> is copied in the returned token.

◆ Units_Token() [4/6]

Units_Token::Units_Token ( const char *const aword,
const char *const amean )

Creates and returns a token. <aword> is a string containing the available word and <amean> gives the signification of the token.

◆ Units_Token() [5/6]

Units_Token::Units_Token ( const char *const aword,
const char *const amean,
const double 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.

◆ Units_Token() [6/6]

Units_Token::Units_Token ( const char *const aword,
const char *const amean,
const double avalue,
const occ::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>.

Member Function Documentation

◆ Add() [1/2]

occ::handle< Units_Token > Units_Token::Add ( const int aninteger) const

◆ Add() [2/2]

occ::handle< Units_Token > Units_Token::Add ( const occ::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.

◆ Creates()

virtual occ::handle< Units_Token > Units_Token::Creates ( ) const
virtual

Creates and returns a token, which is a ShiftedToken.

Reimplemented in Units_ShiftedToken.

◆ Dimensions() [1/2]

occ::handle< Units_Dimensions > Units_Token::Dimensions ( ) const

Returns the dimensions of the token <thedimensions>.

◆ Dimensions() [2/2]

void Units_Token::Dimensions ( const occ::handle< Units_Dimensions > & adimensions)

Sets the field <thedimensions> to <adimensions>.

◆ Divide()

occ::handle< Units_Token > Units_Token::Divide ( const occ::handle< Units_Token > & atoken) const

Returns a token which is the division of <me> by another token <atoken>.

◆ Divided()

virtual double Units_Token::Divided ( const double avalue) const
virtual

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

Reimplemented in Units_ShiftedToken.

◆ Dump()

virtual void Units_Token::Dump ( const int ashift,
const int alevel ) const
virtual

Useful for debugging.

Reimplemented in Units_ShiftedToken.

◆ IsEqual() [1/2]

bool Units_Token::IsEqual ( const char *const astring) const

Returns true if the field <theword> and the string <astring> are the same, false otherwise.

◆ IsEqual() [2/2]

bool Units_Token::IsEqual ( const occ::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.

◆ IsGreater() [1/2]

bool Units_Token::IsGreater ( const char *const astring) const

Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.

◆ IsGreater() [2/2]

bool Units_Token::IsGreater ( const occ::handle< Units_Token > & atoken) const

Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.

◆ IsGreaterOrEqual()

bool Units_Token::IsGreaterOrEqual ( const occ::handle< Units_Token > & atoken) const

Returns true if the string <astring> is strictly contained at the beginning of the field <theword> false otherwise.

◆ IsLessOrEqual()

bool Units_Token::IsLessOrEqual ( const char *const astring) const

Returns true if the field <theword> is strictly contained at the beginning of the string <astring>, false otherwise.

◆ IsNotEqual() [1/2]

bool Units_Token::IsNotEqual ( const char *const astring) const

Returns false if the field <theword> and the string <astring> are the same, true otherwise.

◆ IsNotEqual() [2/2]

bool Units_Token::IsNotEqual ( const occ::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.

◆ Length()

int Units_Token::Length ( ) const

Returns the length of the word.

◆ Mean() [1/2]

TCollection_AsciiString Units_Token::Mean ( ) const

Returns the significance of the word <theword>, which is in the field <themean>.

◆ Mean() [2/2]

void Units_Token::Mean ( const char *const amean)

Sets the field <themean> to <amean>.

◆ Multiplied()

virtual double Units_Token::Multiplied ( const double avalue) const
virtual

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

Reimplemented in Units_ShiftedToken.

◆ Multiply()

occ::handle< Units_Token > Units_Token::Multiply ( const occ::handle< Units_Token > & atoken) const

Returns a token which is the product of <me> and another token <atoken>.

◆ Power() [1/2]

occ::handle< Units_Token > Units_Token::Power ( const double anexponent) const

Returns a token which is <me> to the power of <anexponent>.

◆ Power() [2/2]

occ::handle< Units_Token > Units_Token::Power ( const occ::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.

◆ Subtract()

occ::handle< Units_Token > Units_Token::Subtract ( const occ::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.

◆ Update()

void Units_Token::Update ( const char *const amean)

Updates the token <me> with the additional signification <amean> by concatenation of the two strings <themean> and <amean>. If the two significations are the same, an information message is written in the output device.

◆ Value() [1/2]

double Units_Token::Value ( ) const

Returns the value stored in the field <thevalue>.

◆ Value() [2/2]

void Units_Token::Value ( const double avalue)

Sets the field <thevalue> to <avalue>.

◆ Word() [1/2]

TCollection_AsciiString Units_Token::Word ( ) const

Returns the string <theword>

◆ Word() [2/2]

void Units_Token::Word ( const char *const aword)

Sets the field <theword> to <aword>.


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