IRSOL
C++ code implementing socket server for interacting with Baumer camera.
assert.hpp
Go to the documentation of this file.
1// clang-format off
25// clang-format on
26
27#pragma once
28
119#ifdef IRSOL_DISABLE_ASSERT
120#ifdef PPK_ASSERT_ENABLED
121#if PPK_ASSERT_ENABLED
122#error "PPK_ASSERT_ENABLED is set to 1, but IRSOL_DISABLE_ASSERT is defined."
123#endif
124#else
125#define PPK_ASSERT_ENABLED 0
126#endif
127#else
128#define PPK_ASSERT_ENABLED 1
129#endif
130
131#include <ppk_assert/ppk_assert.hpp>
132
133#define IRSOL_ASSERT_DEBUG PPK_ASSERT_DEBUG
134#define IRSOL_ASSERT_ERROR PPK_ASSERT_ERROR
135#define IRSOL_ASSERT_FATAL PPK_ASSERT_FATAL
136#define IRSOL_ASSERT_FALSE(message) IRSOL_ASSERT_FATAL(false, message)
137
138#define IRSOL_STATIC_ASSERT PPK_STATIC_ASSERT
139
140namespace irsol {
141
149using AssertionException = ppk::assert::AssertionException;
150
170typedef ppk::assert::implementation::AssertAction::AssertAction (*AssertHandler)(
171 const char* file,
172 int line,
173 const char* function,
174 const char* expression,
175 int level,
176 const char* message);
177
188
202void initAssertHandler();
203
204namespace internal {
205
224ppk::assert::implementation::AssertAction::AssertAction assertHandler(
225 const char* file,
226 int line,
227 const char* function,
228 const char* expression,
229 int level,
230 const char* message);
231
232} // namespace internal
233} // namespace irsol
void setAssertHandler(AssertHandler handler)
Sets a custom assertion handler function.
ppk::assert::implementation::AssertAction::AssertAction assertHandler(const char *file, int line, const char *function, const char *expression, int level, const char *message)
Internal default assertion handler implementation.
Definition assert.cpp:22
void initAssertHandler()
Initializes the assertion handler system.
Definition assert.cpp:14
ppk::assert::implementation::AssertAction::AssertAction(* AssertHandler)(const char *file, int line, const char *function, const char *expression, int level, const char *message)
Definition assert.hpp:170
ppk::assert::AssertionException AssertionException
Definition assert.hpp:149