ITK  6.0.0
Insight Toolkit
itkFloatingPointExceptions.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkFloatingPointExceptions_h
19#define itkFloatingPointExceptions_h
20
21#include "itkMacro.h" // for ITKCommon_EXPORT
22#include "itkSingletonMacro.h"
23
24namespace itk
25{
31{
32public:
36 enum class ExceptionAction : uint8_t
37 {
38 ABORT,
39 EXIT
40 };
41};
42// Define how to print enumeration
43extern ITKCommon_EXPORT std::ostream &
44 operator<<(std::ostream & out, const FloatingPointExceptionsEnums::ExceptionAction value);
45
53struct ExceptionGlobals;
54
55class ITKCommon_EXPORT FloatingPointExceptions
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(FloatingPointExceptions);
59 // default constructor required for wrapping to succeed
61 virtual ~FloatingPointExceptions() = default;
62
64#if !defined(ITK_LEGACY_REMOVE)
66 using ExceptionAction = ExceptionActionEnum;
67 static constexpr ExceptionActionEnum ABORT = ExceptionActionEnum::ABORT;
68 static constexpr ExceptionActionEnum EXIT = ExceptionActionEnum::EXIT;
69#endif
70
82 static void
84
89 static void
91
93 static bool
95
100 static void
101 SetEnabled(bool val);
102
104 static void
106
110
112 static bool
114
115private:
116 itkGetGlobalDeclarationMacro(ExceptionGlobals, PimplGlobals);
118 static ExceptionGlobals * m_PimplGlobals;
119};
120} // namespace itk
121
122#endif
Contains all enum classes used by FloatingPointExceptions class.
Allows floating point exceptions to be caught during program execution.
static ExceptionGlobals * m_PimplGlobals
itkGetGlobalDeclarationMacro(ExceptionGlobals, PimplGlobals)
static ExceptionActionEnum GetExceptionAction()
virtual ~FloatingPointExceptions()=default
static bool HasFloatingPointExceptionsSupport()
static void SetExceptionAction(ExceptionActionEnum a)
static void SetEnabled(bool val)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)