IDS peak ICV v1.3.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
32class Exception : public virtual peak::common::Exception
33{
34private:
35 peak_icv_status m_status;
36
37public:
38 Exception(const std::string& msg, peak_icv_status status)
39 : peak::common::Exception(msg)
40 , m_status{ status }
41 {}
42
43 PEAK_COMMON_NO_DISCARD peak_icv_status GetStatus() const;
44};
45
53{
54public:
55 explicit InvalidConfigurationException(const std::string& msg, peak_icv_status status)
56 : peak::common::Exception(msg)
57 , Exception(msg, status)
58 {}
59
64};
65
73 : public Exception
75{
76public:
77 explicit InternalErrorException(const std::string& msg, peak_icv_status status)
78 : peak::common::Exception(msg)
79 , Exception(msg, status)
80 , peak::common::InternalErrorException(msg)
81 {}
82
88};
89
96class MismatchException final : public Exception
97{
98public:
99 explicit MismatchException(const std::string& msg)
100 : peak::common::Exception(msg)
101 , Exception(msg, PEAK_ICV_STATUS_MISMATCH)
102 {}
103
106 , Exception(other)
107 {}
108};
109
117 : public Exception
119{
120public:
121 explicit NotSupportedException(const std::string& msg)
122 : peak::common::Exception(msg)
123 , Exception(msg, PEAK_ICV_STATUS_NOT_SUPPORTED)
124 , peak::common::NotSupportedException(msg)
125 {}
126
132};
133
140class NotPossibleException final : public Exception
141{
142public:
143 explicit NotPossibleException(const std::string& msg)
144 : peak::common::Exception(msg)
145 , Exception(msg, PEAK_ICV_STATUS_NOT_POSSIBLE)
146 {}
147
150 , Exception(other)
151 {}
152};
153
161 : public Exception
163{
164public:
165 explicit OutOfRangeException(const std::string& msg)
166 : peak::common::Exception(msg)
167 , Exception(msg, PEAK_ICV_STATUS_OUT_OF_RANGE)
168 , peak::common::OutOfRangeException(msg)
169 {}
170
173 , Exception(other)
175 {}
176};
177
184class MathErrorException final : public Exception
185{
186public:
187 explicit MathErrorException(const std::string& msg)
188 : peak::common::Exception(msg)
189 , Exception(msg, PEAK_ICV_STATUS_MATH_ERROR)
190 {}
191
194 , Exception(other)
195 {}
196};
197
205{
206public:
207 explicit TargetNotFoundException(const std::string& msg)
208 : peak::common::Exception(msg)
209 , Exception(msg, PEAK_ICV_STATUS_TARGET_NOT_FOUND)
210 {}
211
214 , Exception(other)
215 {}
216};
217
224class CorruptedException final : public Exception
225{
226public:
227 explicit CorruptedException(const std::string& msg)
228 : peak::common::Exception(msg)
229 , Exception(msg, PEAK_ICV_STATUS_CORRUPTED)
230 {}
231
234 , Exception(other)
235 {}
236};
237
244class IOException final
245 : public Exception
247{
248public:
249 explicit IOException(const std::string& msg)
250 : peak::common::Exception(msg)
251 , Exception(msg, PEAK_ICV_STATUS_IO_ERROR)
252 , peak::common::IOException(msg)
253 {}
254
255 IOException(const IOException& other) noexcept
257 , Exception(other)
259 {}
260};
261
268class NullPointerException final : public Exception
269{
270public:
271 explicit NullPointerException(const std::string& msg)
272 : peak::common::Exception(msg)
273 , Exception(msg, PEAK_ICV_STATUS_NULL_POINTER)
274 {}
275
278 , Exception(other)
279 {}
280};
281
282inline peak_icv_status Exception::GetStatus() const
283{
284 return m_status;
285}
286
287} /* namespace icv */
288} /* 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.
Occurs when reading from a file or stream that is incomplete, damaged, or in an unexpected format.
CorruptedException(const std::string &msg)
CorruptedException(const CorruptedException &other) noexcept
Base class for all exceptions thrown by the IDS peak ICV library.
peak_icv_status GetStatus() const
Exception(const std::string &msg, peak_icv_status status)
Occurs when a file operation fails (e.g., missing file, insufficient permissions, or inaccessible dir...
IOException(const std::string &msg)
IOException(const IOException &other) noexcept
Occurs when a failure happens during processing due to an unhandled internal routine condition.
InternalErrorException(const std::string &msg, peak_icv_status status)
InternalErrorException(const InternalErrorException &other) noexcept
Occurs when a required dependency is missing, the library is not initialized, or a misconfiguration a...
InvalidConfigurationException(const std::string &msg, peak_icv_status status)
InvalidConfigurationException(const InvalidConfigurationException &other) noexcept
Occurs when a mathematical computation fails (e.g., division by zero or invalid matrix operations).
MathErrorException(const MathErrorException &other) noexcept
MathErrorException(const std::string &msg)
Occurs when input parameters do not match expected conditions (e.g., two input images have different ...
MismatchException(const MismatchException &other) noexcept
MismatchException(const std::string &msg)
Occurs when an operation cannot be performed due to logical constraints (e.g., camera calibration wit...
NotPossibleException(const std::string &msg)
NotPossibleException(const NotPossibleException &other) noexcept
Occurs when a requested operation is not implemented or supported (e.g., exporting to an unsupported ...
NotSupportedException(const NotSupportedException &other) noexcept
NotSupportedException(const std::string &msg)
Occurs when attempting to access an object or value via an uninitialized or null pointer.
NullPointerException(const std::string &msg)
NullPointerException(const NullPointerException &other) noexcept
Occurs when a provided value falls outside the allowed valid range.
OutOfRangeException(const OutOfRangeException &other) noexcept
OutOfRangeException(const std::string &msg)
Occurs when an expected target object (e.g., calibration plate or marker) is not detected in the inpu...
TargetNotFoundException(const TargetNotFoundException &other) noexcept
TargetNotFoundException(const std::string &msg)