Class: TFormattableNumber

Declaration: NumberFormat.h

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.

Member Function: TFormattableNumber::TFormattableNumber

  1. TFormattableNumber ()
  2. TFormattableNumber (const double number)
  3. TFormattableNumber (const TFormattableNumber & copy)

Interface Category:

API.

Purpose:

  1. Default constructor. Creates a formattable that wraps the number 0.
  2. Creates a formattable that wraps the specified number.
  3. Copy constructor.

Calling Context:

  1. Called directly to instantiate this class.
  2. Called to instantiate a TFormattableNumber containing a specific number.
  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.

Member Function: TFormattableNumber::~TFormattableNumber

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.

Member Function: TFormattableNumber::GetNumber

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.

Member Function: TFormattableNumber::SetNumber

void SetNumber (double)

Interface Category:

API.

Purpose:

Sets the number wrapped by this formattable.

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: TFormattableNumber::GetChoiceValue

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.

Member Function: TFormattableNumber::SetChoiceValue

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFormattableNumber::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: TFormattableNumber::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: TFormattableNumber::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: TFormattableNumber::operator=

  1. virtual TFormattable & operator =(const TFormattable & toCopy)
  2. virtual TFormattableNumber & operator =(const TFormattableNumber & toCopy)

Interface Category:

API.

Purpose:

  1. Inherited assignment operator from class TFormattable.
  2. Assignment operator.

Calling Context:

  1. Called when a TFormattable object is polymorphically assigned to another TFormattableNumber object.
  2. Called when an object is assigned to another compatible object.

Parameters:

Return Value:

  1. Returns a TFormattable reference to this formattable object.
  2. 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.