Lely core libraries
2.3.4
|
Go to the documentation of this file.
24 #ifndef LELY_IO2_CTX_HPP_
25 #define LELY_IO2_CTX_HPP_
53 operator io_ctx_t*()
const noexcept {
return ctx; }
84 if (ec) throw ::std::system_error(ec,
"notify_fork");
102 if (!ctx) util::throw_errc(
"Context");
114 operator=(
Context&& other) noexcept {
116 swap(ctx, other.ctx);
127 #endif // !LELY_IO2_CTX_HPP_
void insert(io_svc &svc) noexcept
void notify_fork(ForkEvent e)
@ IO_FORK_PARENT
The event generated after the fork in the parent process.
A refence to an I/O context. This class is a wrapper around #io_ctx_t*.
ForkEvent
The type of event generated by an I/O context before and after a process fork.
int get_errc(void)
Returns the last (thread-specific) native error code set by a system call or library function.
void io_ctx_insert(io_ctx_t *ctx, struct io_svc *svc)
Registers an I/O service with an I/O context.
@ IO_FORK_PREPARE
The event generated before the fork.
void remove(io_svc &svc) noexcept
void set_errc(int errc)
Sets the current (thread-specific) native error code to errc.
io_ctx_t * io_ctx_create(void)
Creates a new I/O context.
void notify_fork(ForkEvent e, ::std::error_code &ec) noexcept
void io_ctx_shutdown(io_ctx_t *ctx)
Shuts down all registered I/O services in reverse order of registration.
void io_ctx_destroy(io_ctx_t *ctx)
Destroys an I/O context.
int io_ctx_notify_fork(io_ctx_t *ctx, enum io_fork_event e)
Notifies all registered I/O services of the specified fork event.
void io_ctx_remove(io_ctx_t *ctx, struct io_svc *svc)
Unregisters an I/O service with an I/O context.
io_fork_event
The type of event generated by an I/O context before and after a process fork.
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
@ IO_FORK_CHILD
The event generated after the fork in the child process.