Class: TFPEnvironmentScope

Declaration: FPEnvironment.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TFPEnvironmentModifier

Inherited By:

None.

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 save the currently-active environment. The destructor restores this environment.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Do not derive from this class.

Concurrency:

Multithread safe.

Resource Use:

Objects are used as a surrogate for FPU status and control registers. They normally have FPU registers as their state.

Member Function: TFPEnvironmentScope::TFPEnvironmentScope

  1. TFPEnvironmentScope ()
  2. TFPEnvironmentScope (const TFPInactiveEnvironment &)
  3. TFPEnvironmentScope (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). The current environment is saved for later restoration by the destructor.
  2. The copy constructor allows for activating (installing) an inactive environment. The current environment is saved for later restoration by the destructor.
  3. This constructor facilitates changing only the rounding mode. The current environment is saved for later restoration by the destructor.

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:

Objects are used as a surrogate for FPU status and control registers. They normally have FPU registers as their state.

Member Function: TFPEnvironmentScope::~TFPEnvironmentScope

virtual ~ TFPEnvironmentScope ()

Interface Category:

API.

Purpose:

Destructor. Restores the environment saved by the constructor.

Calling Context:

Called to destroy an object and restore a floating-point environment.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFPEnvironmentScope::GetSavedEnvironment

TFPInactiveEnvironment GetSavedEnvironment () const

Interface Category:

API.

Purpose:

Examines the floating-point environment saved by the constructor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the floating-point environment saved by the constructor.

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.