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;
89 std::string entryString;
93 entryString =
"PEAK_IPL_RETURN_CODE_SUCCESS";
97 entryString =
"PEAK_IPL_RETURN_CODE_ERROR";
101 entryString =
"PEAK_IPL_RETURN_CODE_BUFFER_TOO_SMALL";
105 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_ARGUMENT";
109 entryString =
"PEAK_IPL_RETURN_CODE_INVALID_HANDLE";
113 entryString =
"PEAK_IPL_RETURN_CODE_OUT_OF_RANGE";
117 entryString =
"PEAK_IPL_RETURN_CODE_IMAGE_FORMAT_NOT_SUPPORTED";
121 entryString =
"PEAK_IPL_RETURN_CODE_IO_ERROR";
127 template <
class CallableType>
133 size_t lastErrorDescriptionSize = 0;
137 throw Exception(
"Could not query the last error!");
139 std::vector<char> lastErrorDescription(lastErrorDescriptionSize);
141 &lastErrorCode, lastErrorDescription.data(), &lastErrorDescriptionSize)
144 throw Exception(
"Could not query the last error!");
147 std::stringstream errorText;
148 errorText <<
"[Error-Code: " << lastErrorCode <<
" (" 150 <<
") | Error-Description: " << lastErrorDescription.data() <<
"]";
152 switch (lastErrorCode)
167 throw Exception(errorText.str().c_str());
Definition: peak_ipl_backend.h:33
PEAK_IPL_C_API PEAK_IPL_Library_GetLastError(PEAK_IPL_RETURN_CODE *lastErrorCode, char *lastErrorDescription, size_t *lastErrorDescriptionSize)
Queries the last error.
#define PEAK_IPL_C_ABI_PREFIX
Definition: peak_ipl_dll_defines.h:16
The base class for all exceptions thrown by the library.
Definition: peak_ipl_exception.hpp:34
Definition: peak_ipl_backend.h:37
int32_t PEAK_IPL_RETURN_CODE
Definition: peak_ipl_backend.h:41
The "peak::ipl" namespace contains the whole image processing library.
Definition: peak_ipl_binning.hpp:16
Definition: peak_ipl_backend.h:35
The exception thrown when an given image format can not be used on this data e.g. during reading from...
Definition: peak_ipl_exception.hpp:82
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition: peak_ipl_exception.hpp:128
Definition: peak_ipl_backend.h:36
The exception thrown when passing an invalid parameter to a function.
Definition: peak_ipl_exception.hpp:58
Definition: peak_ipl_backend.h:34
The exception thrown for trying to access a value being out of range.
Definition: peak_ipl_exception.hpp:42
The exception thrown when an given buffer is to small for for the data.
Definition: peak_ipl_exception.hpp:50
Definition: peak_ipl_backend.h:30
std::string StringFromPEAK_IPL_RETURN_CODE(PEAK_IPL_RETURN_CODE_t entry)
Definition: peak_ipl_exception.hpp:87
Definition: peak_ipl_backend.h:32
Definition: peak_ipl_backend.h:38
Definition: peak_ipl_backend.h:31
PEAK_IPL_RETURN_CODE_t
Definition: peak_ipl_backend.h:28