Skip to main content

class thread_queue::event

Declaration

class thread_queue::event : public async_event_impl { /* full declaration omitted */ };

Description

Abstract base class for async_event implementations.

Inherits from: async_event_impl

Member Variables

std::variant<std::future<completion>, completion> m_state

Member Function Overview

Inherited from async_event_impl:

Member Functions

explicit event(std::future<completion> future)

Parameters

std::future<completion> future

std::optional<std::chrono::nanoseconds>
get_native_execution_time()

Description

Returns the time execution time as measured if profiling was enabled in the issuing component. Requires is_complete() to be true.


void* get_result()

Description

There is only one instruction type which returns a result, namely alloc_instruction returning a pointer to the allocated memory, i.e. a void*. Having a void* return type on async_event_impl is somewhat leaky, but we don't gain much by wrapping it in a std::any.


bool is_complete()

Description

If this function returns true once, the implementation must guarantee that it will always do so in the future. The event is expected to be cheap to poll repeatedly, and the operation must proceed in the background even while not being polled.


completion* get_completed()