7#include "utility/module.hpp"
9namespace hi::inline
v1 {
33[[nodiscard]]
constexpr callback_flags operator|(callback_flags
const &lhs, callback_flags
const &rhs)
noexcept
35 hi_assert((to_underlying(lhs) & 0xff) == 0 or (to_underlying(rhs) & 0xff) == 0);
36 return static_cast<callback_flags
>(to_underlying(lhs) | to_underlying(rhs));
39[[nodiscard]]
constexpr bool is_once(callback_flags
const &rhs)
noexcept
41 return to_bool(to_underlying(rhs) & to_underlying(callback_flags::once));
44[[nodiscard]]
constexpr bool is_synchronous(callback_flags
const& rhs)
noexcept
46 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::synchronous));
49[[nodiscard]]
constexpr bool is_local(callback_flags
const& rhs)
noexcept
51 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::local));
54[[nodiscard]]
constexpr bool is_main(callback_flags
const& rhs)
noexcept
56 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::main));
59[[nodiscard]]
constexpr bool is_timer(callback_flags
const& rhs)
noexcept
61 return to_bool((to_underlying(rhs) & 0xff) == to_underlying(callback_flags::timer));
#define hi_assert(expression,...)
Assert if expression is true.
Definition assert.hpp:184
DOXYGEN BUG.
Definition algorithm.hpp:13
callback_flags
Definition callback_flags.hpp:11
@ 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.