boost::corosio::native_timer

An asynchronous timer with devirtualized wait operations.

Synopsis

template<auto Backend>
class native_timer
    : public timer

Description

This class template inherits from timer and shadows the wait operation with a version that calls the backend implementation directly, allowing the compiler to inline through the entire call chain.

Non‐async operations (cancel, expires_at, expires_after) remain unchanged and dispatch through the compiled library.

A native_timer IS‐A timer and can be passed to any function expecting timer&.

Thread Safety

Same as timer.

Base Classes

Name

Description

timer

An asynchronous timer for coroutine I/O.

Types

Name

Description

handle

RAII wrapper for I/O object implementation lifetime.

implementation

Backend interface for timer wait operations.

io_service

Service interface for I/O object lifecycle management.

Type Aliases

Name

Description

clock_type

The clock type used for time operations.

duration

The duration type for relative expiry times.

implementation

Alias for backward compatibility.

time_point

The time point type for absolute expiry times.

Member Functions

Name

Description

native_timer [constructor] [deleted]

Constructors

operator= [deleted]

Assignment operators

cancel

Cancel all pending asynchronous wait operations.

cancel_one

Cancel one pending asynchronous wait operation.

context

Return the execution context.

expires_after

Set the timer's expiry time relative to now.

expires_at

Set the timer's expiry time as an absolute time.

expiry

Return the timer's expiry time as an absolute time.

wait

Wait for the timer to expire.

Protected Member Functions

Name

Description

operator= [deleted]

Assignment operators

do_cancel [virtual]

Dispatch cancel to the concrete implementation.

get

Return the underlying implementation.

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.

Template Parameters

Name

Description

Backend

A backend tag value (e.g., epoll). The timer implementation is backend‐independent; the tag selects the concrete impl type for devirtualization.

See Also

timer, epoll_t, iocp_t

Created with MrDocs