HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
debugger_utils.hpp
1// Copyright Take Vos 2023.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
8#pragma once
9
10#include "../macros.hpp"
11
12hi_export_module(hikogui.utils.debugger : utils);
13
14hi_export namespace hi { inline namespace v1 {
15namespace detail {
18hi_inline std::atomic<char const *> debug_message = nullptr;
19
20}
21
22hi_inline void set_debug_message(char const *str) noexcept
23{
24 detail::debug_message.store(str, std::memory_order::relaxed);
25}
26
27[[nodiscard]] hi_inline bool has_debug_message() noexcept
28{
29 return detail::debug_message.load(std::memory_order::relaxed) != nullptr;
30}
31
32[[nodiscard]] hi_inline char const *get_debug_message() noexcept
33{
34 return detail::debug_message.exchange(nullptr, std::memory_order::relaxed);
35}
36
37}}
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378