15#include <peak_common/exceptions/peak_common_exceptions.hpp>
38class Exception :
public virtual peak::common::Exception
40 using peak::common::Exception::Exception;
73 using Exception::Exception;
85 ,
peak::common::InvalidParameterException(what)
91 ,
peak::common::InvalidParameterException(what)
97 ,
peak::common::InvalidParameterException(other)
110 ,
peak::common::NotSupportedException(what)
116 ,
peak::common::NotSupportedException(what)
122 ,
peak::common::NotSupportedException(other)
131 using Exception::Exception;
164 using Exception::Exception;
172 using Exception::Exception;
205 using Exception::Exception;
210 std::string entryString;
215 entryString =
"PEAK_IPL_RETURN_CODE_SUCCESS";
219 entryString =
"PEAK_IPL_RETURN_CODE_ERROR";
223 entryString =
"PEAK_IPL_RETURN_CODE_BUFFER_TOO_SMALL";
227 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_ARGUMENT";
231 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_HANDLE";
235 entryString =
"PEAK_IPL_RETURN_CODE_OUT_OF_RANGE";
239 entryString =
"PEAK_IPL_RETURN_CODE_IMAGE_FORMAT_NOT_SUPPORTED";
243 entryString =
"PEAK_IPL_RETURN_CODE_IO_ERROR";
247 entryString =
"PEAK_IPL_RETURN_CODE_BUSY";
251 entryString =
"PEAK_IPL_RETURN_CODE_TIMEOUT";
255 entryString =
"PEAK_IPL_RETURN_CODE_FORMAT_INTERPRETATION_ERROR";
259 entryString =
"PEAK_IPL_RETURN_CODE_NOT_SUPPORTED";
263 entryString =
"PEAK_IPL_RETURN_CODE_NOT_PERMITTED";
270template <
class CallableType>
276 size_t lastErrorDescriptionSize = 0;
280 throw Exception(
"Could not query the last error!");
282 std::vector<char> lastErrorDescription(lastErrorDescriptionSize);
284 &lastErrorCode, lastErrorDescription.data(), &lastErrorDescriptionSize)
287 throw Exception(
"Could not query the last error!");
290 std::stringstream errorText;
291 errorText <<
"[Error-Code: " << lastErrorCode <<
" ("
293 <<
") | Error-Description: " << lastErrorDescription.data() <<
"]";
295 switch (lastErrorCode)
318 throw Exception(errorText.str().c_str());
The exception thrown when a given buffer is too small for the data.
Definition peak_ipl_exception.hpp:72
The exception thrown when the resource busy.
Definition peak_ipl_exception.hpp:163
The base class for all exceptions thrown by the library.
Definition peak_ipl_exception.hpp:39
The exception thrown when a given image format can't be used on this data, e.g. during reading from f...
Definition peak_ipl_exception.hpp:138
IOException(const std::string &what)
Definition peak_ipl_exception.hpp:140
IOException(const char *what)
Definition peak_ipl_exception.hpp:146
IOException(const IOException &other)
Definition peak_ipl_exception.hpp:152
The exception thrown when passing an invalid parameter to a function.
Definition peak_ipl_exception.hpp:80
InvalidArgumentException(const std::string &what)
Definition peak_ipl_exception.hpp:82
InvalidArgumentException(const char *what)
Definition peak_ipl_exception.hpp:88
InvalidArgumentException(const InvalidArgumentException &other)
Definition peak_ipl_exception.hpp:94
The exception thrown when passing an invalid handle to a function.
Definition peak_ipl_exception.hpp:204
The exception thrown when the operation not permitted.
Definition peak_ipl_exception.hpp:171
The exception thrown for trying to access a value being out of range.
Definition peak_ipl_exception.hpp:47
OutOfRangeException(const char *what)
Definition peak_ipl_exception.hpp:55
OutOfRangeException(const OutOfRangeException &other)
Definition peak_ipl_exception.hpp:61
OutOfRangeException(const std::string &what)
Definition peak_ipl_exception.hpp:49
The exception thrown when the operation times out.
Definition peak_ipl_exception.hpp:179
TimeoutException(const TimeoutException &other)
Definition peak_ipl_exception.hpp:193
TimeoutException(const char *what)
Definition peak_ipl_exception.hpp:187
TimeoutException(const std::string &what)
Definition peak_ipl_exception.hpp:181
The "peak::ipl" namespace contains the whole image processing library.
std::string StringFromPEAK_IPL_RETURN_CODE(PEAK_IPL_RETURN_CODE_t entry)
Definition peak_ipl_exception.hpp:208
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition peak_ipl_exception.hpp:271
int32_t PEAK_IPL_RETURN_CODE
Definition peak_ipl_backend.h:46
PEAK_IPL_C_API PEAK_IPL_Library_GetLastError(PEAK_IPL_RETURN_CODE *lastErrorCode, char *lastErrorDescription, size_t *lastErrorDescriptionSize)
Queries the last error.
PEAK_IPL_RETURN_CODE_t
Definition peak_ipl_backend.h:30
@ PEAK_IPL_RETURN_CODE_SUCCESS
Definition peak_ipl_backend.h:31
@ PEAK_IPL_RETURN_CODE_OUT_OF_RANGE
Definition peak_ipl_backend.h:37
@ PEAK_IPL_RETURN_CODE_IO_ERROR
Definition peak_ipl_backend.h:34
@ PEAK_IPL_RETURN_CODE_FORMAT_INTERPRETATION_ERROR
Definition peak_ipl_backend.h:39
@ PEAK_IPL_RETURN_CODE_INVALID_HANDLE
Definition peak_ipl_backend.h:33
@ PEAK_IPL_RETURN_CODE_INVALID_ARGUMENT
Definition peak_ipl_backend.h:36
@ PEAK_IPL_RETURN_CODE_BUFFER_TOO_SMALL
Definition peak_ipl_backend.h:35
@ PEAK_IPL_RETURN_CODE_ERROR
Definition peak_ipl_backend.h:32
@ PEAK_IPL_RETURN_CODE_NOT_PERMITTED
Definition peak_ipl_backend.h:41
@ PEAK_IPL_RETURN_CODE_BUSY
Definition peak_ipl_backend.h:42
@ PEAK_IPL_RETURN_CODE_IMAGE_FORMAT_NOT_SUPPORTED
Definition peak_ipl_backend.h:38
@ PEAK_IPL_RETURN_CODE_TIMEOUT
Definition peak_ipl_backend.h:43
@ PEAK_IPL_RETURN_CODE_NOT_SUPPORTED
Definition peak_ipl_backend.h:40
#define PEAK_IPL_C_ABI_PREFIX
Definition peak_ipl_dll_defines.h:16