Class: TCanonicalNumberException

Declaration: CanonicalNumber.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TStandardException

Inherited By:

None.

Purpose:

Objects represent exceptions thrown when setting invalid values in the data members of TCanonicalNumber objects. Derived from the TStandardException, inherits the StandardException Framework. TCanonicalNumber setters can throw these exceptions: kInvalidBase: Tried to set an invalid base (see notes for valid bases). kInvalidMRoundValue: Tried to set an invalid RoundToMultiple value (not a reasonable product of powers of 2 and 5).

Instantiation:

Allocate on the stack or the heap, preferably on the stack.

Deriving Classes:

May derive if usage requires currently unexceptional behavior to propagate an exception. Deriving would require overriding the one-parameter constructor, the GetReason member function, and possibly the destructor and assignment operator. Overriding would probably require adding another constant value to enum EReason and corresponding exception text in the library archive.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TCanonicalNumberException::~TCanonicalNumberException

virtual ~ TCanonicalNumberException ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TCanonicalNumberException::operator=

TCanonicalNumberException & operator =(const TCanonicalNumberException &)

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:

Multithread safe.

Other Considerations:

None.

Member Function: TCanonicalNumberException::GetReason

EReason GetReason () const

Interface Category:

API.

Purpose:

Queries the reason for a particular exception.

Calling Context:

Called to query the reason for a particular exception. May be called directly. Designed to work in non-default floating-point rounding modes.

Parameters:

Return Value:

The current exception reason.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TCanonicalNumberException::Throw

virtual void Throw () const

Interface Category:

API.

Purpose:

Throws the current exception object.

Calling Context:

Called by a client trying to throw the current exception object. May be called directly. Designed to work in non-default floating-point rounding modes.

Parameters:

Return Value:

None.

Exceptions:

Throws a TCanonicalNumberException.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TCanonicalNumberException::TCanonicalNumberException

  1. TCanonicalNumberException (EReason)
  2. TCanonicalNumberException ()
  3. TCanonicalNumberException (const TCanonicalNumberException &)

Interface Category:

API.

Purpose:

  1. This constructor is used when the exception cause is known.
  2. Default constructor.
  3. Copy constructor.

Calling Context:

  1. Called by the setters of Base and RoundToMultiple when the value to be set is invalid.
  2. Called by the stream-in operators.
  3. Called to copy an object.
  4. Designed to work in non-default floating-point rounding modes.

Parameters:

Return Value:

None.

Exceptions:

TCanonicalNumber represents these exceptions: kInvalidBase : Tried to set TCanonicalNumberConverter to an invalid base (see notes for valid bases). kInvalidMRoundValue : Tried to set an invalid RoundToMultiple value (not a reasonable product of power's of 2 and 5).

Concurrency:

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.