Class: THybridNumerals

Declaration: Numerals.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TNumerals

Inherited By:

None.

Purpose:

This class, derived from TNumerals, contains an arbitrary set of mapping rules between characters and values. It maintains the rules as two sets, scanning pairs and formatting pairs. Each pair consists of a Unicode character and a value.

Instantiation:

Always allocate on the heap.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: THybridNumerals::~THybridNumerals

virtual ~ THybridNumerals ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::NumeralToValue

virtual bool NumeralToValue (UniChar ch, long & value)

Interface Category:

API.

Purpose:

Converts a character into a numeric value.

Calling Context:

Called during the scanning operation.

Parameters:

Return Value:

Returns true if the character can be converted into a numeric value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::ValueToNumeral

virtual bool ValueToNumeral (long value, UniChar & ch)

Interface Category:

API.

Purpose:

Converts a numeric value into a character representation.

Calling Context:

Called during the formatting operation.

Parameters:

Return Value:

Returns true if the number can be converted into a character.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::FormattingCount

virtual short FormattingCount () const

Interface Category:

API.

Purpose:

Counts the number of formatting pairs contained by this THybridNumerals.

Calling Context:

Called during the formatting operation, which loops through each pair to find a match.

Parameters:

Return Value:

The number of formatting pairs contained by this THybridNumerals.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::ScanningCount

virtual short ScanningCount () const

Interface Category:

API.

Purpose:

Counts the number of scanning pairs contained by this THybridNumerals.

Calling Context:

Called during the scanning operation, which loops through each pair to find a match.

Parameters:

Return Value:

The number of scanning pairs contained by this THybridNumerals.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::GetFormattingPair

virtual void GetFormattingPair (unsigned short index, UniChar & numeral, long & value) const

Interface Category:

API.

Purpose:

Gets the formatting pair at a specified index within the list of pairs for this THybridNumerals. Pairs are indexed beginning at 0.

Calling Context:

Called during the formatting operation to retrieve formatting pairs.

Parameters:

Return Value:

None.

Exceptions:

Throws TStandardException if the specified index is between 0 (inclusive) and the number of pairs, or if a pair does not exist at that index.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::GetScanningPair

virtual void GetScanningPair (unsigned short index, UniChar & numeral, long & value) const

Interface Category:

API.

Purpose:

Gets the scanning pair at a specified index within the list of pairs for this THybridNumerals. Pairs are indexed beginning at 0.

Calling Context:

Called during the scanning operation to retrieve scanning pairs.

Parameters:

Return Value:

None.

Exceptions:

Throws TStandardException if the specified index is between 0 (inclusive) and the number of pairs, or if a pair does not exist at that index.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::AddFormattingPair

virtual void AddFormattingPair (UniChar numeral, long value)

Interface Category:

API.

Purpose:

Adds a formatting pair to the list of pairs for this THybridNumerals. The pair will also be added to the list of scanning pairs.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::AddScanningPair

virtual void AddScanningPair (UniChar numeral, long value)

Interface Category:

API.

Purpose:

Adds a scanning pair to the list of pairs for this THybridNumerals.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::operator=

THybridNumerals & operator =(const THybridNumerals &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws a TStandardException if the version of the formatter cannot be used on the current system.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

Called to generate a hash value.

Parameters:

Return Value:

The numeric value of the hash.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::CreateStandardHexNumerals

static THybridNumerals * CreateStandardHexNumerals ()

Interface Category:

API.

Purpose:

Creates a THybridNumerals object that represents the hexadecimal numbering system.

Calling Context:

Call this function directly. Called by a number formatter if you set its base to 16.

Parameters:

Return Value:

A pointer to the new object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THybridNumerals::THybridNumerals

  1. THybridNumerals ()
  2. THybridNumerals (short minBase, short maxBase)
  3. THybridNumerals (const THybridNumerals &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a THybridNumerals that uses base 10 numbering.
  3. Copy constructor.

Calling Context:

  1. Called directly to instantiate this class.
  2. Call directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.