36 using std::runtime_error::runtime_error;
44 using Exception::Exception;
52 using Exception::Exception;
60 using Exception::Exception;
68 using Exception::Exception;
76 using Exception::Exception;
84 using Exception::Exception;
92 using Exception::Exception;
100 using Exception::Exception;
108 using Exception::Exception;
116 using Exception::Exception;
121 std::string entryString;
126 entryString =
"PEAK_IPL_RETURN_CODE_SUCCESS";
130 entryString =
"PEAK_IPL_RETURN_CODE_ERROR";
134 entryString =
"PEAK_IPL_RETURN_CODE_BUFFER_TOO_SMALL";
138 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_ARGUMENT";
142 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_HANDLE";
146 entryString =
"PEAK_IPL_RETURN_CODE_OUT_OF_RANGE";
150 entryString =
"PEAK_IPL_RETURN_CODE_IMAGE_FORMAT_NOT_SUPPORTED";
154 entryString =
"PEAK_IPL_RETURN_CODE_IO_ERROR";
158 entryString =
"PEAK_IPL_RETURN_CODE_BUSY";
162 entryString =
"PEAK_IPL_RETURN_CODE_TIMEOUT";
166 entryString =
"PEAK_IPL_RETURN_CODE_FORMAT_INTERPRETATION_ERROR";
170 entryString =
"PEAK_IPL_RETURN_CODE_NOT_SUPPORTED";
174 entryString =
"PEAK_IPL_RETURN_CODE_NOT_PERMITTED";
181template <
class CallableType>
187 size_t lastErrorDescriptionSize = 0;
191 throw Exception(
"Could not query the last error!");
193 std::vector<char> lastErrorDescription(lastErrorDescriptionSize);
195 &lastErrorCode, lastErrorDescription.data(), &lastErrorDescriptionSize)
198 throw Exception(
"Could not query the last error!");
201 std::stringstream errorText;
202 errorText <<
"[Error-Code: " << lastErrorCode <<
" ("
204 <<
") | Error-Description: " << lastErrorDescription.data() <<
"]";
206 switch (lastErrorCode)
229 throw Exception(errorText.str().c_str());
The exception thrown when a given buffer is too small for the data.
Definition peak_ipl_exception.hpp:51
The exception thrown when the resource busy.
Definition peak_ipl_exception.hpp:91
The base class for all exceptions thrown by the library.
Definition peak_ipl_exception.hpp:35
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:83
The exception thrown when passing an invalid parameter to a function.
Definition peak_ipl_exception.hpp:59
The exception thrown when passing an invalid handle to a function.
Definition peak_ipl_exception.hpp:115
The exception thrown when the operation not permitted.
Definition peak_ipl_exception.hpp:99
The exception thrown for trying to access a value being out of range.
Definition peak_ipl_exception.hpp:43
The exception thrown when the operation times out.
Definition peak_ipl_exception.hpp:107
std::string StringFromPEAK_IPL_RETURN_CODE(PEAK_IPL_RETURN_CODE_t entry)
Definition peak_ipl_exception.hpp:119
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition peak_ipl_exception.hpp:182
The "peak::ipl" namespace contains the whole image processing library.
Definition peak_ipl_binning.hpp:23
int32_t PEAK_IPL_RETURN_CODE
Definition peak_ipl_backend.h:61
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:45
@ PEAK_IPL_RETURN_CODE_SUCCESS
Definition peak_ipl_backend.h:46
@ PEAK_IPL_RETURN_CODE_OUT_OF_RANGE
Definition peak_ipl_backend.h:52
@ PEAK_IPL_RETURN_CODE_IO_ERROR
Definition peak_ipl_backend.h:49
@ PEAK_IPL_RETURN_CODE_FORMAT_INTERPRETATION_ERROR
Definition peak_ipl_backend.h:54
@ PEAK_IPL_RETURN_CODE_INVALID_HANDLE
Definition peak_ipl_backend.h:48
@ PEAK_IPL_RETURN_CODE_INVALID_ARGUMENT
Definition peak_ipl_backend.h:51
@ PEAK_IPL_RETURN_CODE_BUFFER_TOO_SMALL
Definition peak_ipl_backend.h:50
@ PEAK_IPL_RETURN_CODE_ERROR
Definition peak_ipl_backend.h:47
@ PEAK_IPL_RETURN_CODE_NOT_PERMITTED
Definition peak_ipl_backend.h:56
@ PEAK_IPL_RETURN_CODE_BUSY
Definition peak_ipl_backend.h:57
@ PEAK_IPL_RETURN_CODE_IMAGE_FORMAT_NOT_SUPPORTED
Definition peak_ipl_backend.h:53
@ PEAK_IPL_RETURN_CODE_TIMEOUT
Definition peak_ipl_backend.h:58
@ PEAK_IPL_RETURN_CODE_NOT_SUPPORTED
Definition peak_ipl_backend.h:55
#define PEAK_IPL_C_ABI_PREFIX
Definition peak_ipl_dll_defines.h:16