Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

future< void >

Description

future

Synopsis
class future< void >
{
  // ...
};
Member Function(s)

Function

Description

Parameters

Returns

future(future< void > && o, stl_future< void > && result)

future< void > &&: o:

stl_future< void > &&: result:

future()

Default constructor.

future(const future & o)

Copy constructor.

const future &: o:

future(future && o)

Move constructor.

future &&: o:

future(dispatcher * parent, size_t id, shared_future< handle_ptr > handle,
       bool check_handle = true, bool validate = true)

dispatcher *: parent: The dispatcher this op belongs to.

size_t: id: The unique non-zero id of this op.

shared_future< handle_ptr >: handle: A shared_ptr to shared state between all instances of this reference.

bool: check_handle: Whether to have validation additionally check if a handle is not null

bool: validate: Whether to check the inputs and shared state for valid (and not errored) values

future(handle_ptr _handle, bool check_handle = true, bool validate = true)

handle_ptr: _handle: A shared_ptr to shared state between all instances of this reference.

bool: check_handle: Whether to have validation additionally check if a handle is not null

bool: validate: Whether to check the inputs and shared state for valid (and not errored) values

future(dispatcher * parent, size_t id)

dispatcher *: parent: The dispatcher this op belongs to.

size_t: id: The unique non-zero id of this op.

future & operator=(const future & o)

Copy assignment.

const future &: o:

future & operator=(future && o)

Move assignment.

future &&: o:

bool valid()

True if this future is valid.

operator bool()

Same as true_(tribool(*this))

bool is_ready()

True if monad is not empty.

bool has_value()

True if monad contains a value_type.

bool has_error()

True if monad contains an error_type.

bool has_exception(bool only_exception = false)

True if monad contains an exception_type or error_type (any error_type is returned as an exception_ptr by get_exception()). This needs to be true for both for compatibility with Boost.Thread's future. If you really want to test only for has exception only, pass true as the argument.

bool: only_exception:

dispatcher * parent()

The parent dispatcher of this future.

size_t id()
handle_ptr get_handle(bool return_null_if_errored = false)

Retrieves the handle or exception from the shared state, rethrowing any exception. Returns a null shared pointer if this future is invalid.

bool: return_null_if_errored:

handle_ptr get_handle(error_type & ec)

Retrieves the handle or exception from the shared state, rethrowing any exception but setting _ec if there is an error. Returns a null shared pointer if this future is invalid.

error_type &: ec:

const handle & operator*()

Dereferences the handle from the shared state. Same as *h.get_handle().

handle & operator*()

Dereferences the handle from the shared state. Same as *h.get_handle().

const handle * operator->()

Dereferences the handle from the shared state. Same as h.get_handle()->get().

handle * operator->()

Dereferences the handle from the shared state. Same as h.get_handle()->get().

void get()

Waits for the future to become ready, rethrowing any exception found. Throws a future_errc::no_state if this future is invalid.

error_type get_error()

Waits for the future to become ready, returning any error state found.

exception_type get_exception()

Waits for the future to become ready, returning any error state found.

void wait()

Waits for the future to become ready. Throws a future_errc::no_state if this future is invalid.

template<class Rep, class Period>
future_status wait_for(const chrono::duration< Rep, Period > & duration)

Waits for the future to become ready for a period. Throws a future_errc::no_state if this future is invalid.

const chrono::duration< Rep, Period > &: duration:

template<class Clock, class Duration>
future_status wait_until(const chrono::time_point< Clock, Duration > & deadline)

Waits for the future to become ready until a deadline. Throws a future_errc::no_state if this future is invalid.

const chrono::time_point< Clock, Duration > &: deadline:

template<class U>
auto then(U && f)

Schedules a callable to be invoked after this future becomes ready. If this future is null, use the current async file i/o dispatcher.

U &&: f:

bool validate(bool check_handle = true)

Validates contents.

bool: check_handle:

Header

#include <boost/afio/v2/afio.hpp>


PrevUpHomeNext