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.
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:
- UniChar ch -The character to convert into a value.
- long & value -Receives the value represented by the character.
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:
- long value -The numeric value to convert into a character.
- UniChar & ch -Receives the character representing the numeric value.
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:
- unsigned short index -The index of the formatting pair to get.
- UniChar & numeral -Receives the character part of the pair.
- long & value -Receives the value part of the pair.
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:
- unsigned short index -The index of the scanning pair to get.
- UniChar & numeral -Receives the character part of the pair.
- long & value -Receives the value part of the pair.
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:
- UniChar numeral -The character part of the pair.
- long value -The value part of the pair.
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:
- UniChar numeral -The character part of the pair.
- long value -The value part of the pair.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object is streamed out to.
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.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object is streamed in from.
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.
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.
- THybridNumerals ()
- THybridNumerals (short minBase, short maxBase)
- THybridNumerals (const THybridNumerals &)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a THybridNumerals that uses base 10 numbering.
- Copy constructor.
Calling Context:
- Called directly to instantiate this class.
- Call directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- short minBase -The minimum base number this object can support.
- short maxBase -The maximum base number this object can support.
- const THybridNumerals & -The object to copy.
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.