10namespace hi::inline
v1 {
34[[nodiscard]]
constexpr callback_flags operator|(callback_flags
const &lhs, callback_flags
const &rhs)
noexcept
36 hi_assert((to_underlying(lhs) & 0xff) == 0 or (to_underlying(rhs) & 0xff) == 0);
37 return static_cast<callback_flags
>(to_underlying(lhs) | to_underlying(rhs));
40[[nodiscard]]
constexpr bool is_once(callback_flags
const &rhs)
noexcept
42 return to_bool(to_underlying(rhs) & to_underlying(callback_flags::once));
45[[nodiscard]]
constexpr bool is_synchronous(callback_flags
const& rhs)
noexcept
47 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::synchronous));
50[[nodiscard]]
constexpr bool is_local(callback_flags
const& rhs)
noexcept
52 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::local));
55[[nodiscard]]
constexpr bool is_main(callback_flags
const& rhs)
noexcept
57 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::main));
60[[nodiscard]]
constexpr bool is_timer(callback_flags
const& rhs)
noexcept
62 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::timer));
Utilities to assert and bound check.
#define hi_assert(expression)
Assert if expression is true.
Definition assert.hpp:86
DOXYGEN BUG.
Definition algorithm.hpp:15
callback_flags
Definition callback_flags.hpp:12
@ 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.