Class: TFPEnvironmentModifier

Declaration: FPEnvironment.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TFPEnvironment

Inherited By:

TFPEnvironmentSaveAndUpdate TFPEnvironmentScope

Purpose:

Objects serve as surrogates for the real floating-point environment (typically hardware control and status registers). Modifying one can affect subsequent floating-point operations. The constructors of this class do not save the current active environment. They are intended to make permanent changes to the environment; the changes remain in effect until explicit subsequent operations change the environment. The destructor does nothing.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

class TFPEnvironmentScope : public TFPEnvironmentModifier. class TFPEnvSaveAndRestore : public TFPEnvironmentModifier. Do not derive from this class.

Concurrency:

Multithread safe.

Resource Use:

Normally only one TFPEnvironmentModifier object is used at a time, as a surrogate for FPU status and control registers. Objects of this class normally have FPU registers as their state.

Member Function: TFPEnvironmentModifier::TFPEnvironmentModifier

  1. TFPEnvironmentModifier ()
  2. TFPEnvironmentModifier (const TFPInactiveEnvironment &)
  3. TFPEnvironmentModifier (EFPRoundingDirection direction)

Interface Category:

API.

Purpose:

  1. Default constructor. The empty constructor initializes the environment to the existing current environment (that is, it changes nothing).
  2. The copy constructor allows for activating (installing) an inactive environment.
  3. This constructor facilitates changing only the rounding mode.

Calling Context:

  1. Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Normally only one TFPEnvironmentModifier object is used at a time, as a surrogate for FPU status and control registers. Objects of this class normally have FPU registers as their state.

Member Function: TFPEnvironmentModifier::~TFPEnvironmentModifier

virtual ~ TFPEnvironmentModifier ()

Interface Category:

API.

Purpose:

Destructor. Does nothing.

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

virtual void operator =(const TFPInactiveEnvironment &)

Interface Category:

API.

Purpose:

Assignment operator, allows activating (installing) an inactive environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::GetRoundingDirection

virtual EFPRoundingDirection GetRoundingDirection () const

Interface Category:

API.

Purpose:

Returns the rounding direction in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the rounding direction in the current environment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::SetRoundingDirection

virtual void SetRoundingDirection (EFPRoundingDirection direction)

Interface Category:

API.

Purpose:

Sets the rounding direction in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::TestFlags

virtual bool TestFlags (TFPExceptionSet exceptions) const

Interface Category:

API.

Purpose:

Tests whether particular exceptions are set in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if and only if any exceptions in its argument are set in the current environment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::ClearFlags

virtual void ClearFlags (TFPExceptionSet exceptions)

Interface Category:

API.

Purpose:

Clears exception flags in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::GetFlags

virtual TFPExceptionSet GetFlags () const

Interface Category:

API.

Purpose:

Returns those exceptions that are set in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns those exceptions that are set in the current environment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::SetFlags

virtual void SetFlags (TFPExceptionSet exceptions)

Interface Category:

API.

Purpose:

Sets exceptions in the current environment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentModifier::Reset

virtual void Reset ()

Interface Category:

API.

Purpose:

Resets the current environment to the default startup state.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

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.