MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MsqFPE Class Reference

Utility class used by InstructionQueue SIGFPE option. More...

#include <MsqFPE.hpp>

Public Member Functions

 MsqFPE (bool enabled)
 Set FPE state.
 ~MsqFPE ()
 Restore FPE state.

Static Public Member Functions

static bool fpe_trap_supported ()
 Check if FPE state manipulation is supported on this platform.
static int get_current_fpe_state ()
static void set_current_fpe_state (int state)
static void enable_trap_fpe ()

Private Member Functions

void * operator new (size_t)
 dummy declaration preventing heap allocation
 MsqFPE (const MsqFPE &)
 dummy declaration preventing default copy constructor
MsqFPEoperator= (const MsqFPE &)
 dummy declaration preventing default assignment operator

Private Attributes

bool isEnabled
int prevState

Detailed Description

Utility class used by InstructionQueue SIGFPE option.

This is a simple utility class for enabling floating point exceptions. It provides two functionalities. The first, implemented in the static methods, is a platform-independent mechanism for modifying the the FPE state. The second, implemented in the constructor/destructor, is a utlity for setting and resetting the FPE state. The FPE state is set when the object is created and reset when the object is destroted. The intention is that an instance of this object be declared on the stack such that when the instantiating function returns, the destructor is automatically invoked, restoring the original state.

Definition at line 50 of file MsqFPE.hpp.


Constructor & Destructor Documentation

MBMesquite::MsqFPE::MsqFPE ( bool  enabled)

Set FPE state.

If enabled == true, floating point exceptions are enabled by the constructor and reset by the destructor. If enabled == false, nothing is done.

Definition at line 138 of file MsqFPE.cpp.

References enable_trap_fpe(), get_current_fpe_state(), isEnabled, and prevState.

Restore FPE state.

Definition at line 147 of file MsqFPE.cpp.

MBMesquite::MsqFPE::MsqFPE ( const MsqFPE ) [private]

dummy declaration preventing default copy constructor


Member Function Documentation

Returns:
Enable trapping of INVALID, DIVBYZERO, and OVERFLOW

Definition at line 134 of file MsqFPE.cpp.

Referenced by MsqFPE().

{}

Check if FPE state manipulation is supported on this platform.

Definition at line 122 of file MsqFPE.cpp.

{
    return false;
}
Returns:
An integer representing the current FPE flags

Definition at line 127 of file MsqFPE.cpp.

Referenced by MsqFPE().

{
    return 0;
}
void* MBMesquite::MsqFPE::operator new ( size_t  ) [private]

dummy declaration preventing heap allocation

MsqFPE& MBMesquite::MsqFPE::operator= ( const MsqFPE ) [private]

dummy declaration preventing default assignment operator

void MBMesquite::MsqFPE::set_current_fpe_state ( int  state) [static]
Returns:
Set the FPE flags on the processor

Definition at line 132 of file MsqFPE.cpp.

{}

Member Data Documentation

Saved constructor argument for use in destructor

Definition at line 82 of file MsqFPE.hpp.

Referenced by MsqFPE().

Saved FPE state for use in destructor

Definition at line 84 of file MsqFPE.hpp.

Referenced by MsqFPE().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines