|
ATLAS Offline Software
|
Go to the documentation of this file.
24 m_toolSvc (
"ToolSvc",
name),
29 m_removeInFinalize(false),
38 std::vector<std::string> defexc;
39 defexc.push_back (
"invalid");
40 defexc.push_back (
"divbyzero");
41 defexc.push_back (
"overflow");
63 if ( fesetround(FE_TONEAREST) )
64 REPORT_MESSAGE (MSG::WARNING) <<
"Couldn't change FE Rounding to mode FE_TONEAREST !";
68 if ( fesetround(FE_UPWARD) )
69 REPORT_MESSAGE (MSG::WARNING) <<
"Couldn't change FE Rounding to mode FE_UPWARD !";
73 if ( fesetround(FE_DOWNWARD) )
74 REPORT_MESSAGE (MSG::WARNING) <<
"Couldn't change FE Rounding to mode FE_DOWNWARD !";
78 if ( fesetround(FE_TOWARDZERO) )
79 REPORT_MESSAGE (MSG::WARNING) <<
"Couldn't change FE Rounding to mode FE_TOWARDZERO !";
85 return StatusCode::SUCCESS;
101 return StatusCode::SUCCESS;
128 std::string mask_to_string (
int mask)
131 if (
mask & FE_INEXACT)
133 if (
mask & FE_DIVBYZERO)
135 if (
mask & FE_UNDERFLOW)
137 if (
mask & FE_OVERFLOW)
139 if (
mask & FE_INVALID)
169 for (
size_t i = 0;
i <
v.size();
i++) {
171 const char*
s =
v[
i].c_str();
178 if (strcasecmp (
s,
"inexact") == 0)
179 thisexc = FE_INEXACT;
180 else if (strcasecmp (
s,
"divbyzero") == 0)
181 thisexc = FE_DIVBYZERO;
182 else if (strcasecmp (
s,
"underflow") == 0)
183 thisexc = FE_UNDERFLOW;
184 else if (strcasecmp (
s,
"overflow") == 0)
185 thisexc = FE_OVERFLOW;
186 else if (strcasecmp (
s,
"invalid") == 0)
187 thisexc = FE_INVALID;
190 <<
"Unknown exception name: " <<
v[
i];
206 <<
"Enable: " << mask_to_string (
m_enabled)
207 <<
"Disable: " << mask_to_string (
m_disabled);
222 #elif defined __APPLE__
bool m_removeInFinalize
boolean to decide to (not) remove the observer in finalize
virtual StatusCode initialize()
Standard initialize method.
void setFPU()
Set the FPU exception masks from m_enabled and m_disabled.
ServiceHandle< IToolSvc > m_toolSvc
Tool service.
bool m_haveEnv
Flag that we've retrieved the environment.
Declarations of feenableexcept()/fedisableexcept() functions for MacOSX.
int m_disabled
Mask of disabled exceptions.
virtual StatusCode finalize()
Standard finalize method.
void prophand(Gaudi::Details::PropertyBase &prop)
Property change handler.
std::string m_feSetRounding
flag to decide on rounding mode (for stability tests)
fenv_t m_env
The FP environment before we initialize.
::StatusCode StatusCode
StatusCode definition for legacy code.
StringArrayProperty m_exceptions
Property specifying the desired exception mask.
Service to enable or disable floating-point exceptions.
#define CHECK(...)
Evaluate an expression and check for errors.
AthROOTErrorHandlerSvc * svc
virtual void onCreate(const IAlgTool *)
Called after each tool has been created.
Helpers for checking error return status codes and reporting errors.
int m_enabled
Mask of enabled exceptions.
#define REPORT_MESSAGE(LVL)
Report a message.
FPEControlSvc(const std::string &name, ISvcLocator *svcloc)
Constructor.