alias details::uvw_poll_event to poll_event_flags

This commit is contained in:
Reimu NotMoe 2023-05-05 22:46:25 +08:00
parent eea2c9463f
commit 43a4474469
2 changed files with 4 additions and 3 deletions

View File

@ -20,7 +20,7 @@ UVW_INLINE void poll_handle::start_callback(uv_poll_t *hndl, int status, int eve
if(poll_handle &poll = *(static_cast<poll_handle *>(hndl->data)); status) {
poll.publish(error_event{status});
} else {
poll.publish(poll_event{details::uvw_poll_event(events)});
poll.publish(poll_event{poll_event_flags(events)});
}
}
@ -32,7 +32,7 @@ UVW_INLINE int poll_handle::init() {
}
}
UVW_INLINE int poll_handle::start(details::uvw_poll_event flags) {
UVW_INLINE int poll_handle::start(poll_event_flags flags) {
return uv_poll_start(raw(), static_cast<uv_poll_event>(flags), &start_callback);
}

View File

@ -60,6 +60,7 @@ class poll_handle final: public handle<poll_handle, uv_poll_t, poll_event> {
static void start_callback(uv_poll_t *hndl, int status, int events);
public:
using poll_event_flags = details::uvw_poll_event;
explicit poll_handle(loop::token token, std::shared_ptr<loop> ref, int desc);
explicit poll_handle(loop::token token, std::shared_ptr<loop> ref, os_socket_handle sock);
@ -89,7 +90,7 @@ public:
* @param flags The events to which the caller is interested.
* @return Underlying return value.
*/
int start(details::uvw_poll_event flags);
int start(poll_event_flags flags);
/**
* @brief Stops polling the file descriptor.