IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
peak_icv_exception.hpp
Go to the documentation of this file.
1
11#pragma once
12
14#include <peak_common_c/detail/peak_common_defines.h>
15#include <peak_icv_c/types/peak_icv_simple_types.h>
16
17#include <stdexcept>
18#include <string>
19#include <vector>
20
21namespace peak
22{
23namespace icv
24{
25
33class Exception : public virtual peak::common::Exception
34{
35private:
36 peak_icv_status m_status;
37
38public:
47 Exception(const std::string& msg, peak_icv_status status)
48 : peak::common::Exception(msg)
49 , m_status{ status }
50 {}
51
53 PEAK_COMMON_NO_DISCARD peak_icv_status GetStatus() const;
55};
56
67{
68public:
69 explicit InvalidConfigurationException(const std::string& msg, peak_icv_status status)
70 : peak::common::Exception(msg)
71 , Exception(msg, status)
72 {}
73
78};
79
90 : public Exception
92{
93public:
94 explicit InternalErrorException(const std::string& msg, peak_icv_status status)
95 : peak::common::Exception(msg)
96 , Exception(msg, status)
97 , peak::common::InternalErrorException(msg)
98 {}
99
105};
106
116class MismatchException final : public Exception
117{
118public:
119 explicit MismatchException(const std::string& msg)
120 : peak::common::Exception(msg)
121 , Exception(msg, PEAK_ICV_STATUS_MISMATCH)
122 {}
123
126 , Exception(other)
127 {}
128};
129
140 : public Exception
142{
143public:
144 explicit NotSupportedException(const std::string& msg)
145 : peak::common::Exception(msg)
146 , Exception(msg, PEAK_ICV_STATUS_NOT_SUPPORTED)
147 , peak::common::NotSupportedException(msg)
148 {}
149
155};
156
166class NotPossibleException final : public Exception
167{
168public:
169 explicit NotPossibleException(const std::string& msg)
170 : peak::common::Exception(msg)
171 , Exception(msg, PEAK_ICV_STATUS_NOT_POSSIBLE)
172 {}
173
176 , Exception(other)
177 {}
178};
179
190 : public Exception
192{
193public:
194 explicit OutOfRangeException(const std::string& msg)
195 : peak::common::Exception(msg)
196 , Exception(msg, PEAK_ICV_STATUS_OUT_OF_RANGE)
197 , peak::common::OutOfRangeException(msg)
198 {}
199
202 , Exception(other)
204 {}
205};
206
216class MathErrorException final : public Exception
217{
218public:
219 explicit MathErrorException(const std::string& msg)
220 : peak::common::Exception(msg)
221 , Exception(msg, PEAK_ICV_STATUS_MATH_ERROR)
222 {}
223
226 , Exception(other)
227 {}
228};
229
240{
241public:
242 explicit TargetNotFoundException(const std::string& msg)
243 : peak::common::Exception(msg)
244 , Exception(msg, PEAK_ICV_STATUS_TARGET_NOT_FOUND)
245 {}
246
249 , Exception(other)
250 {}
251};
252
262class CorruptedException final : public Exception
263{
264public:
265 explicit CorruptedException(const std::string& msg)
266 : peak::common::Exception(msg)
267 , Exception(msg, PEAK_ICV_STATUS_CORRUPTED)
268 {}
269
272 , Exception(other)
273 {}
274};
275
285class IOException final
286 : public Exception
288{
289public:
290 explicit IOException(const std::string& msg)
291 : peak::common::Exception(msg)
292 , Exception(msg, PEAK_ICV_STATUS_IO_ERROR)
293 , peak::common::IOException(msg)
294 {}
295
296 IOException(const IOException& other) noexcept
298 , Exception(other)
300 {}
301};
302
312class NullPointerException final : public Exception
313{
314public:
315 explicit NullPointerException(const std::string& msg)
316 : peak::common::Exception(msg)
317 , Exception(msg, PEAK_ICV_STATUS_NULL_POINTER)
318 {}
319
322 , Exception(other)
323 {}
324};
325
327inline peak_icv_status Exception::GetStatus() const
328{
329 return m_status;
330}
331
333
334} /* namespace icv */
335} /* namespace peak */
Base class for all exceptions thrown by the library.
Thrown when an input, output, file or device communication error occurs.
Thrown when an unexpected internal error occurs.
Thrown when an unsupported operation or feature is used.
Thrown when a parameter is outside the valid range.
Thrown when input data or a file is malformed, unreadable, or otherwise corrupted.
CorruptedException(const std::string &msg)
CorruptedException(const CorruptedException &other) noexcept
The base class for all exceptions thrown by the IDS peak ICV library.
Exception(const std::string &msg, peak_icv_status status)
Creates an Exception from string and peak_icv_status.
Thrown when a file input/output operation fails.
IOException(const std::string &msg)
IOException(const IOException &other) noexcept
Thrown on unexpected internal system errors.
InternalErrorException(const std::string &msg, peak_icv_status status)
InternalErrorException(const InternalErrorException &other) noexcept
Thrown when the library configuration is invalid.
InvalidConfigurationException(const std::string &msg, peak_icv_status status)
InvalidConfigurationException(const InvalidConfigurationException &other) noexcept
Thrown when a mathematical computation fails.
MathErrorException(const MathErrorException &other) noexcept
MathErrorException(const std::string &msg)
Thrown when input parameters do not match the expected conditions.
MismatchException(const MismatchException &other) noexcept
MismatchException(const std::string &msg)
Thrown when an operation cannot be performed due to logical constraints.
NotPossibleException(const std::string &msg)
NotPossibleException(const NotPossibleException &other) noexcept
Thrown when a requested operation is not implemented or supported.
NotSupportedException(const NotSupportedException &other) noexcept
NotSupportedException(const std::string &msg)
Thrown when attempting to access an object or value that has not been initialized.
NullPointerException(const std::string &msg)
NullPointerException(const NullPointerException &other) noexcept
Thrown when a value is outside the allowed range.
OutOfRangeException(const OutOfRangeException &other) noexcept
OutOfRangeException(const std::string &msg)
Thrown when an expected target object is not detected in the input image.
TargetNotFoundException(const TargetNotFoundException &other) noexcept
TargetNotFoundException(const std::string &msg)