boost::corosio::io_object

Base class for platform I/O objects.

Synopsis

class io_object;

Description

Provides common infrastructure for I/O objects that wrap kernel resources (sockets, timers, signal handlers, acceptors). Derived classes dispatch operations through a platform‐specific vtable (IOCP, epoll, kqueue, io_uring).

Semantics

Only concrete platform I/O types should inherit from io_object. Test mocks, decorators, and stream adapters must not inherit from this class. Use concepts or templates for generic I/O algorithms.

Thread Safety

Distinct objects: Safe. Shared objects: Unsafe. All operations on a single I/O object must be serialized.

Intended as a protected base class. The implementation pointer impl_ is accessible to derived classes.

Types

Name

Description

handle

RAII wrapper for I/O object implementation lifetime.

implementation

Forward declaration for platform‐specific implementation.

io_object_impl

Base interface for platform I/O implementations.

io_service

Service interface for I/O object lifecycle management.

Member Functions

Name

Description

context

Return the execution context.

Protected Member Functions

Name

Description

io_object [constructor]

Construct an I/O object bound to the given context.

~io_object [destructor] [virtual]

Destructor

Protected Data Members

Name

ctx_

impl_

Derived Classes

Name Description

io_stream

Platform stream with read/write operations.

resolver

An asynchronous DNS resolver for coroutine I/O.

signal_set

An asynchronous signal set for coroutine I/O.

tcp_acceptor

An asynchronous TCP acceptor for coroutine I/O.

timer

An asynchronous timer for coroutine I/O.

See Also

io_stream, tcp_socket, tcp_acceptor

Created with MrDocs