Lely core libraries
2.2.5
|
Go to the documentation of this file.
24 #ifndef LELY_IO2_POSIX_FD_LOOP_HPP_
25 #define LELY_IO2_POSIX_FD_LOOP_HPP_
41 if (!loop_) util::throw_errc(
"FdLoop");
47 other.loop_ =
nullptr;
53 operator=(
FdLoop&& other) noexcept {
55 swap(loop_, other.loop_);
62 operator io_fd_loop_t*()
const noexcept {
return loop_; }
103 ::std::error_code ec;
104 auto result =
run(ec);
105 if (ec) throw ::std::system_error(ec,
"run");
111 run(::std::error_code& ec) {
123 ::std::error_code ec;
125 if (ec) throw ::std::system_error(ec,
"run_one");
134 auto result = io_fd_loop_run_one(*
this);
147 #endif // !LELY_IO2_POSIX_FD_LOOP_HPP_
::std::size_t run(::std::error_code &ec)
ev::Executor get_executor() const noexcept
size_t io_fd_loop_run(io_fd_loop_t *loop)
Equivalent to.
bool stopped() const noexcept
@ see io_fd_loop_stopped()
void io_fd_loop_stop(io_fd_loop_t *loop)
Stops the file descriptor event loop.
ev::Poll get_poll() const noexcept
int io_fd_loop_get_fd(const io_fd_loop_t *loop)
Returns the file descriptor corresponding to the event loop.
int get_fd() const noexcept
ev_poll_t * io_fd_loop_get_poll(const io_fd_loop_t *loop)
Returns a pointer to the polling instance used by the event loop.
int get_errc(void)
Returns the last (thread-specific) native error code set by a system call or library function.
int io_fd_loop_stopped(io_fd_loop_t *loop)
Returns 1 if the file descriptor event loop is stopped, and 0 if not.
ev_exec_t * io_fd_loop_get_exec(const io_fd_loop_t *loop)
Returns a pointer to the executor corresponding to the event loop.
void set_errc(int errc)
Sets the current (thread-specific) native error code to errc.
An abstract task executor. This class is a wrapper around #ev_exec_t*.
An I/O polling interface.
A file descriptor event loop.
void io_fd_loop_destroy(io_fd_loop_t *loop)
Destroys a file descriptor event loop.
void io_fd_loop_restart(io_fd_loop_t *loop)
Restarts a file descriptor event loop.
::std::size_t run_one(::std::error_code &ec)
A file descriptor event loop.
The abstract polling interface.
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
io_fd_loop_t * io_fd_loop_create(io_poll_t *poll)
Creates a new file descriptor event loop.