go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLMacro.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 * http://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 *=========================================================================*/
25#ifndef itkOpenCLMacro_h
26#define itkOpenCLMacro_h
27
28#include "itkMacro.h"
29#include "itkOpenCLExport.h"
30
31#include <string>
32#include <sstream>
33
37#define itkOpenCLDebugMacro(x) itkOpenCLDebugWithObjectMacro(this, x)
38
42#define itkOpenCLWarningMacro(x) itkOpenCLWarningWithObjectMacro(this, x)
43
47#define itkOpenCLErrorMacro(x) itkOpenCLErrorWithObjectMacro(this, x)
48
52#define itkOpenCLDebugMacroGeneric(x) \
53 { \
54 std::stringstream itkmsg; \
55 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL generic debug." \
56 << "\nDebug: in function: " << __FUNCTION__ << "\nDetails: " x << "\n\n"; \
57 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
58 }
59
63#define itkOpenCLWarningMacroGeneric(x) \
64 { \
65 std::stringstream itkmsg; \
66 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL generic warning." \
67 << "\nWarning: in function: " << __FUNCTION__ << "\nDetails: " x << "\n\n"; \
68 ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
69 }
70
74#define itkOpenCLErrorMacroGeneric(x) \
75 { \
76 std::stringstream itkmsg; \
77 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL generic error." \
78 << "\nError: in function: " << __FUNCTION__ << "\nDetails: " x << "\n\n"; \
79 ::itk::OutputWindowDisplayErrorText(itkmsg.str().c_str()); \
80 }
81
88#define itkOpenCLDebugWithObjectMacro(self, x) \
89 { \
90 std::stringstream itkmsg; \
91 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL debug." \
92 << "\nDebug: in function: " << __FUNCTION__ << "; Name: " << self->GetNameOfClass() << " (" << self << ")" \
93 << "\nDetails: " x << "\n\n"; \
94 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
95 }
96
103#define itkOpenCLWarningWithObjectMacro(self, x) \
104 { \
105 std::stringstream itkmsg; \
106 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL warning." \
107 << "\nWarning: in function: " << __FUNCTION__ << "; Name: " << self->GetNameOfClass() << " (" << self \
108 << ")" \
109 << "\nDetails: " x << "\n\n"; \
110 ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
111 }
112
119#define itkOpenCLErrorWithObjectMacro(self, x) \
120 { \
121 std::stringstream itkmsg; \
122 itkmsg << __FILE__ << "(" << __LINE__ << "): itkOpenCL error." \
123 << "\nError: in function: " << __FUNCTION__ << "; Name: " << self->GetNameOfClass() << " (" << self << ")" \
124 << "\nDetails: " x << "\n\n"; \
125 ::itk::OutputWindowDisplayErrorText(itkmsg.str().c_str()); \
126 }
127
128namespace itk
129{
133class ITKOpenCL_EXPORT OpenCLCompileError : public ExceptionObject
134{
135public:
138 : ExceptionObject()
139 {}
140
142 OpenCLCompileError(const char * file, unsigned int lineNumber)
143 : ExceptionObject(file, lineNumber)
144 {}
145
147 OpenCLCompileError(const std::string & file, unsigned int lineNumber)
148 : ExceptionObject(file, lineNumber)
149 {}
150
152 ~OpenCLCompileError() override = default;
153
154 const char *
155 GetNameOfClass() const override
156 {
157 return "OpenCLCompileError";
158 }
159};
160
161} // namespace itk
162#endif /* itkOpenCLMacro_h */
~OpenCLCompileError() override=default
OpenCLCompileError(const char *file, unsigned int lineNumber)
OpenCLCompileError(const std::string &file, unsigned int lineNumber)
const char * GetNameOfClass() const override
#define ITKOpenCL_EXPORT


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo