Sen API
Sen Libraries
Loading...
Searching...
No Matches
assert.h
Go to the documentation of this file.
1// === assert.h ========================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_CORE_BASE_ASSERT_H
9#define SEN_CORE_BASE_ASSERT_H
10
12
13// std
14#include <string>
15
16namespace sen
17{
18
31
34
36#define SEN_EXPECT(expr) ::sen::impl::senCheckImpl((expr), ::sen::impl::CheckType::expect, #expr, SEN_SL())
37
39#define SEN_ASSERT(expr) ::sen::impl::senCheckImpl((expr), ::sen::impl::CheckType::assert, #expr, SEN_SL())
40
42#define SEN_ENSURE(expr) ::sen::impl::senCheckImpl((expr), ::sen::impl::CheckType::ensure, #expr, SEN_SL())
43
46
48[[noreturn]] void throwRuntimeError(const std::string& err);
49
51void trace();
52
56void trace(std::string preMessage);
57
59
60} // namespace sen
61
62#endif // SEN_CORE_BASE_ASSERT_H
void throwRuntimeError(const std::string &err)
Throws std::exception that attempts to collect the stack trace. We also wrap it to avoid including st...
void registerTerminateHandler()
Installs a custom termination handler.
void trace()
Prints the current stack trace to stderr.
Definition assert.h:17