ATLAS Offline Software
Control
CxxUtils
CxxUtils
FPControl.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
* Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
4
*/
13
#ifndef CXXUTILS_FPCONTROL_H
14
#define CXXUTILS_FPCONTROL_H
15
16
17
#include "
CxxUtils/bitmask.h
"
18
#include <fenv.h>
19
20
21
namespace
CxxUtils
{
22
23
40
class
FPControl
41
{
42
public
:
43
// Known exception types.
44
enum class
Exc
45
{
46
divbyzero = 1,
47
inexact = 2,
48
invalid = 4,
49
overflow = 8,
50
underflow = 16,
51
// Special value meaning all known exceptions.
52
// Not necessarily the same as the OR of all the above
53
// if the platform defines additional exception types beyond these.
54
all
= 32,
55
ATH_BITMASK
56
};
57
58
64
FPControl();
65
66
75
~FPControl();
76
77
81
void
holdExceptions();
82
83
88
void
enable (Exc exc);
89
90
95
void
disable (Exc exc);
96
97
98
private
:
103
int
excToMask (Exc exc);
104
106
fenv_t m_env;
107
108
// Mask of exceptions that have been disabled.
109
int
m_masked = 0;
110
};
111
112
113
114
}
// namespace CxxUtils
115
116
117
#endif // not CXXUTILS_FPCONTROL_H
ATH_BITMASK
#define ATH_BITMASK
Mark that a class enum should be treated as a bitmask.
Definition:
bitmask.h:70
Cut::all
@ all
Definition:
SUSYToolsAlg.cxx:67
CxxUtils
Definition:
aligned_vector.h:29
bitmask.h
Helpers for treating a class enum as a bitmask.
Generated on Thu Nov 7 2024 21:15:24 for ATLAS Offline Software by
1.8.18