7#include "../utility/utility.hpp"
8#include "../macros.hpp"
11hi_export_module(hikogui.concurrency.callback_flags);
13hi_export
namespace hi::inline
v1 {
37[[nodiscard]]
constexpr callback_flags operator|(callback_flags
const &lhs, callback_flags
const &rhs)
noexcept
39 hi_assert((std::to_underlying(lhs) & 0xff) == 0 or (std::to_underlying(rhs) & 0xff) == 0);
40 return static_cast<callback_flags
>(std::to_underlying(lhs) | std::to_underlying(rhs));
43[[nodiscard]]
constexpr bool is_once(callback_flags
const &rhs)
noexcept
45 return to_bool(std::to_underlying(rhs) & std::to_underlying(callback_flags::once));
48[[nodiscard]]
constexpr bool is_synchronous(callback_flags
const& rhs)
noexcept
50 return to_bool((std::to_underlying(rhs) & 0xff) == std::to_underlying(callback_flags::synchronous));
53[[nodiscard]]
constexpr bool is_local(callback_flags
const& rhs)
noexcept
55 return to_bool((std::to_underlying(rhs) & 0xff) == std::to_underlying(callback_flags::local));
58[[nodiscard]]
constexpr bool is_main(callback_flags
const& rhs)
noexcept
60 return to_bool((std::to_underlying(rhs) & 0xff) == std::to_underlying(callback_flags::main));
63[[nodiscard]]
constexpr bool is_timer(callback_flags
const& rhs)
noexcept
65 return to_bool((std::to_underlying(rhs) & 0xff) == std::to_underlying(callback_flags::timer));
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
callback_flags
Definition callback_flags.hpp:15
@ synchronous
Call the function synchronously.
@ timer
Call the function asynchronously from the timer thread's loop.
@ once
Call the function once, then automatically unsubscribe.
@ local
Call the function asynchronously from the current thread's loop.
@ main
Call the function asynchronously from the main thread's loop.