Utility class used by InstructionQueue SIGFPE option. More...
#include <MsqFPE.hpp>
Public Member Functions | |
MsqFPE (bool enabled) | |
Set FPE state. More... | |
~MsqFPE () | |
Restore FPE state. More... | |
MsqFPE (bool enabled) | |
Set FPE state. More... | |
~MsqFPE () | |
Restore FPE state. More... | |
Static Public Member Functions | |
static bool | fpe_trap_supported () |
Check if FPE state manipulation is supported on this platform. More... | |
static int | get_current_fpe_state () |
static void | set_current_fpe_state (int state) |
static void | enable_trap_fpe () |
static bool | fpe_trap_supported () |
Check if FPE state manipulation is supported on this platform. More... | |
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 More... | |
MsqFPE (const MsqFPE &) | |
dummy declaration preventing default copy constructor More... | |
MsqFPE & | operator= (const MsqFPE &) |
dummy declaration preventing default assignment operator More... | |
void * | operator new (size_t) |
dummy declaration preventing heap allocation More... | |
MsqFPE (const MsqFPE &) | |
dummy declaration preventing default copy constructor More... | |
MsqFPE & | operator= (const MsqFPE &) |
dummy declaration preventing default assignment operator More... | |
Private Attributes | |
bool | isEnabled |
Saved constructor argument for use in destructor. More... | |
int | prevState |
Saved FPE state for use in destructor. More... | |
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 48 of file includeLinks/MsqFPE.hpp.
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 133 of file Misc/MsqFPE.cpp.
References MsqFPE::enable_trap_fpe(), MsqFPE::get_current_fpe_state(), MsqFPE::isEnabled, and MsqFPE::prevState.
~MsqFPE | ( | ) |
Restore FPE state.
Definition at line 142 of file Misc/MsqFPE.cpp.
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.
~MsqFPE | ( | ) |
Restore FPE state.
|
static |
Definition at line 125 of file Misc/MsqFPE.cpp.
Referenced by MsqFPE::MsqFPE().
|
static |
|
static |
Check if FPE state manipulation is supported on this platform.
Definition at line 116 of file Misc/MsqFPE.cpp.
|
static |
Check if FPE state manipulation is supported on this platform.
|
static |
Definition at line 119 of file Misc/MsqFPE.cpp.
Referenced by MsqFPE::MsqFPE().
|
static |
|
private |
dummy declaration preventing heap allocation
|
private |
dummy declaration preventing heap allocation
dummy declaration preventing default assignment operator
dummy declaration preventing default assignment operator
|
static |
|
static |
|
private |
Saved constructor argument for use in destructor.
Definition at line 82 of file includeLinks/MsqFPE.hpp.
Referenced by MsqFPE::MsqFPE().
|
private |
Saved FPE state for use in destructor.
Definition at line 84 of file includeLinks/MsqFPE.hpp.
Referenced by MsqFPE::MsqFPE().