Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TFormattable
Inherited By:
None.
Purpose:
This class, derived from TFormattable, wraps a number so that it can be handled by a TNumberFormatter.
Instantiation:
Always allocate on the heap.
Deriving Classes:
This class is not designed to be derived.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TFormattableNumber ()
- TFormattableNumber (const double number)
- TFormattableNumber (const TFormattableNumber & copy)
Interface Category:
API.
Purpose:
- Default constructor. Creates a formattable that wraps the number 0.
- Creates a formattable that wraps the specified number.
- Copy constructor.
Calling Context:
- Called directly to instantiate this class.
- Called to instantiate a TFormattableNumber containing a specific number.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const double number -The number to wrap for formatting.
- const TFormattableNumber & copy -The object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TFormattableNumber ()
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.
double GetNumber () const
Interface Category:
API.
Purpose:
Returns the number wrapped by this formattable.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The number wrapped by this formattable.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void SetNumber (double)
Interface Category:
API.
Purpose:
Sets the number wrapped by this formattable.
Calling Context:
Call this function directly.
Parameters:
- double -The number to wrap.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual double GetChoiceValue () const
Interface Category:
API.
Purpose:
Gets a number, based on the wrapped value, to use to select the correct choice in a TChoiceFormatter.
Calling Context:
Called by TChoiceFormatter when formatting.
Parameters:
Return Value:
The number of the correct choice.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetChoiceValue (double value)
Interface Category:
API.
Purpose:
Sets the value wrapped by the formattable based on the correct choice contained by a TChoiceFormatter.
Calling Context:
Called by TChoiceFormatter when scanning.
Parameters:
- double value -The number of the correct choice.
Return Value:
None.
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.
- virtual TFormattable & operator =(const TFormattable & toCopy)
- virtual TFormattableNumber & operator =(const TFormattableNumber & toCopy)
Interface Category:
API.
Purpose:
- Inherited assignment operator from class TFormattable.
- Assignment operator.
Calling Context:
- Called when a TFormattable object is polymorphically assigned to another TFormattableNumber object.
- Called when an object is assigned to another compatible object.
Parameters:
- const TFormattable & toCopy -The formattable object being assigned to this formattable number object.
- const TFormattableNumber & toCopy -The formattable number object being assigned to this formattable number object.
Return Value:
- Returns a TFormattable reference to this formattable object.
- Returns a TFormattableNumber reference to this formattable number object.
Exceptions:
Throws the exception TFormatterException::kIncorrectFormattableProvided if incorrect formattable is provided.
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.