Class: TFormattable

Declaration: Formatter.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TFormattableNumber TFormattableParameterList TFormattableText TFormattableTime

Purpose:

The base class for data that is wrapped so that it can be formatted by a TFormatter.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Anything that needs to be Format or Scan should derive from this class. All formatters can only process a formattable of its own kind or of any of the formattable's base class. Derived classes must provide a protected virtual assignment operator. Derived classes should also override GetChoiceValue and SetChoiceValue, which are needed to support TChoiceFormatter.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TFormattable::~TFormattable

virtual ~ TFormattable ()

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: TFormattable::operator=

virtual TFormattable & operator =(const TFormattable &)

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: TFormattable::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: TFormattable::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 no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFormattable::TFormattable

  1. TFormattable ()
  2. TFormattable (const TFormattable &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. 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: TFormattable::SetChoiceValue

virtual void SetChoiceValue (double value)

Interface Category:

API.

Purpose:

Sets a value for this formattable. This function basically does nothing. It provides a default behavior for all the derived classes of TFormattable. This is needed to support TChoiceFormatter.

Calling Context:

Normally, user will not call this member function. It is being called by TChoiceFormatter.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFormattable::GetChoiceValue

virtual double GetChoiceValue () const

Interface Category:

API.

Purpose:

Gets a value for this formattable. This function always return zero. It provides a default behavior for all the derived classes of TFormattable. This is needed to support TChoiceFormatter.

Calling Context:

Normally, user will not call this member function. It is being called by TChoiceFormatter.

Parameters:

Return Value:

Returns a double.

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.