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 handle member h_ is accessible to derived classes.

Types

Name

Description

handle

RAII wrapper for I/O object implementation lifetime.

implementation

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]

Constructors

~io_object [destructor] [virtual]

Destructor

operator= [deleted]

Move assign from another I/O object.

Protected Static Member Functions

Name

Description

create_handle

Create a handle bound to a service found in the context.

Protected Data Members

Name

Description

h_

The platform I/O handle owned by this object.

Derived Classes

Name

Description

io_read_stream

Abstract base for streams that support async reads.

io_signal_set

Abstract base for asynchronous signal sets.

io_timer

Abstract base for asynchronous timers.

io_write_stream

Abstract base for streams that support async writes.

local_datagram_socket

An asynchronous Unix datagram socket for coroutine I/O.

local_stream_acceptor

An asynchronous Unix domain stream acceptor for coroutine I/O.

random_access_file

An asynchronous random‐access file for coroutine I/O.

resolver

An asynchronous DNS resolver for coroutine I/O.

tcp_acceptor

An asynchronous TCP acceptor for coroutine I/O.

udp_socket

An asynchronous UDP socket for coroutine I/O.

See Also

io_stream, tcp_socket, tcp_acceptor

Created with MrDocs