7#include "../utility/utility.hpp"
8#include "../macros.hpp"
14hi_export_module(hikogui.dispatch.socket_event : intf);
16hi_export
namespace hi::inline
v1 {
18enum class socket_event : uint16_t {
28 address_list_change = 0x0100,
29 routing_interface_changed = 0x0200
32[[nodiscard]]
constexpr socket_event operator|(socket_event
const& lhs, socket_event
const& rhs)
noexcept
34 return static_cast<socket_event
>(std::to_underlying(lhs) | std::to_underlying(rhs));
37[[nodiscard]]
constexpr socket_event operator&(socket_event
const& lhs, socket_event
const& rhs)
noexcept
39 return static_cast<socket_event
>(std::to_underlying(lhs) & std::to_underlying(rhs));
42constexpr socket_event& operator|=(socket_event& lhs, socket_event
const& rhs)
noexcept
44 return lhs = lhs | rhs;
47[[nodiscard]]
constexpr bool to_bool(socket_event
const& rhs)
noexcept
49 return to_bool(std::to_underlying(rhs));
54[[nodiscard]]
constexpr size_t bit(socket_event
const& rhs)
noexcept
56 hi_assert(std::popcount(std::to_underlying(rhs)) == 1);
57 return std::countr_zero(std::to_underlying(rhs));
60enum class socket_error : uint8_t {
72constexpr size_t socket_event_max = 10;
79 constexpr socket_events() noexcept : events(socket_event::none), errors{} {}
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
constexpr size_t bit(socket_event const &rhs) noexcept
Get the bit index of the single bit of the socket_event mask.
Definition socket_event_intf.hpp:54
Definition socket_event_intf.hpp:74