8#ifndef SEN_CORE_BASE_DETAIL_ASSERT_IMPL_H
9#define SEN_CORE_BASE_DETAIL_ASSERT_IMPL_H
25enum class CheckType : std::uint8_t
42 CheckInfo(CheckType checkType, std::string_view expression, SourceLocation sourceLocation)
43 : checkType_(checkType), expression_(expression), sourceLocation_(sourceLocation)
47 [[nodiscard]] CheckType getCheckType() const noexcept {
return checkType_; }
48 [[nodiscard]] std::string_view getExpression() const noexcept {
return expression_; }
49 [[nodiscard]]
const SourceLocation& getSourceLocation() const noexcept {
return sourceLocation_; }
51 [[nodiscard]] std::string str() const noexcept;
53 friend std::ostream& operator<<(std::ostream& s, const CheckInfo& checkInfo) {
return s << checkInfo.str(); }
57 std::string_view expression_;
58 SourceLocation sourceLocation_;
61inline std::optional<CheckInfo> lastReportedAssertionError {std::nullopt};
65using FailedCheckHandler = std::function<void(
const CheckInfo&)>;
71[[nodiscard]] FailedCheckHandler setFailedCheckHandler(FailedCheckHandler handler)
noexcept;
77void senCheckImpl(
bool checkResult,
79 std::string_view expression,
80 const SourceLocation& sourceLocation)
noexcept;