Class: TExceptionFormatter

Declaration: ExceptionFormatter.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TStandardExceptionFormatter

Purpose:

TExceptionFormatter is an abstract base class used to derive classes that format error messages from message templates. An error message template is selected from a supplied archive of message templates, based on the C++ type of the exception and the exception's enum value.

Instantiation:

TExceptionFormatter is an abstract base class and should not be instantiated.

Deriving Classes:

Classes can be derived from TExceptionFormatter to create formatter classes for custom message formats. Deriving classes should override the Format member function.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TExceptionFormatter::TExceptionFormatter

  1. TExceptionFormatter ()
  2. TExceptionFormatter (const TExceptionFormatter & other)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called to create a TExceptionFormatter object suitable for streaming into.
  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: TExceptionFormatter::~TExceptionFormatter

virtual ~ TExceptionFormatter ()

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: TExceptionFormatter::CreateFormatter

static TExceptionFormatter * CreateFormatter (const TAllocationHeap & heap, const TStandardException & exception, const TLocale & locale)

Interface Category:

API.

Purpose:

Creates an exception formatter on the specified heap for the specified exception.

Calling Context:

Called by TStandardExceptionFormatter to create the formatter for the specified exception.

Parameters:

Return Value:

A pointer to the formatter that was created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TExceptionFormatter::GetFormattedText

static void GetFormattedText (const TStandardException & exception, const TLocale & currentLocale, TText & textMessage)

Interface Category:

API.

Purpose:

Fills in the parameter textMessage with the error message for the specified exception.

Calling Context:

Called to obtain the error message associated with the specified exception.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TExceptionFormatter::Format

virtual void Format (const TStandardException & exception, TArchive * Archive, const TLocale & Locale, TText & Message)

Interface Category:

API.

Purpose:

Formats an error message for the specified exception, using the message archive provided. The parameter Message is filled in with the resulting message. Deriving classes must override this member function.

Calling Context:

Called to format an error message for the specified exception.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Deriving classes must override this member function.

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

TExceptionFormatter & operator =(const TExceptionFormatter & other)

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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.