Boost.AFIO    Boost C++ Libraries
Public Member Functions | Protected Member Functions | Friends
boost::afio::future< void > Class Template Reference

List of all members.

Public Member Functions

 future (future< void > &&o, stl_future< void > &&result)
 future ()
 Default constructor.
 future (const future &o)
 Copy constructor.
 future (future &&o)
 Move constructor.
 future (dispatcher *parent, size_t id, shared_future< handle_ptr > handle, bool check_handle=true, bool validate=true)
 future (handle_ptr _handle, bool check_handle=true, bool validate=true)
 future (dispatcher *parent, size_t id)
futureoperator= (const future &o)
 Copy assignment.
futureoperator= (future &&o) noexcept
 Move assignment.
bool valid () const noexcept
 True if this future is valid.
 operator bool () const noexcept
 Same as `true_(tribool(*this))`.
bool is_ready () const noexcept
 True if monad is not empty.
bool has_value () const noexcept
 True if monad contains a value_type.
bool has_error () const noexcept
 True if monad contains an error_type.
bool has_exception (bool only_exception=false) const noexcept
 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.
dispatcherparent () const noexcept
 The parent dispatcher of this future.
size_t id () const noexcept
 
handle_ptr get_handle (bool return_null_if_errored=false) const
 Retrieves the handle or exception from the shared state, rethrowing any exception. Returns a null shared pointer if this future is invalid.
handle_ptr get_handle (error_type &ec) const
 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.
const handleoperator* () const
 Dereferences the handle from the shared state. Same as *h.get_handle().
handleoperator* ()
 Dereferences the handle from the shared state. Same as *h.get_handle().
const handleoperator-> () const
 Dereferences the handle from the shared state. Same as h.get_handle()->get().
handleoperator-> ()
 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 () const
 Waits for the future to become ready, returning any error state found.
exception_type get_exception () const
 Waits for the future to become ready, returning any error state found.
void wait () const
 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) const
 Waits for the future to become ready for a period. Throws a `future_errc::no_state` if this future is invalid.
template<class Clock , class Duration >
future_status wait_until (const chrono::time_point< Clock, Duration > &deadline) const
 Waits for the future to become ready until a deadline. Throws a `future_errc::no_state` if this future is invalid.
template<class U >
auto then (U &&f)-> typename detail
 Schedules a callable to be invoked after this future becomes ready. If this future is null, use the current async file i/o dispatcher.
bool validate (bool check_handle=true) const
 Validates contents.

Protected Member Functions

void _validate (bool check_handle=true) const

Friends

struct detail::barrier_count_completed_state
template<bool rethrow, class Iterator >
stl_future< std::vector
< handle_ptr > > 
detail::when_all_ops (Iterator first, Iterator last)
template<bool rethrow, class Iterator >
stl_future< handle_ptr > detail::when_any_ops (Iterator first, Iterator last)

Detailed Description

template<>
class boost::afio::future< void >

future

Definition at line 1430 of file afio.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 1452 of file afio.hpp.

boost::afio::future< void >::future ( const future< void > &  o)

Copy constructor.

boost::afio::future< void >::future ( future< void > &&  o)

Move constructor.

boost::afio::future< void >::future ( dispatcher parent,
size_t  id,
shared_future< handle_ptr >  handle,
bool  check_handle = true,
bool  validate = true 
)

Constructs an instance.

Parameters:
parentThe dispatcher this op belongs to.
idThe unique non-zero id of this op.
handleA shared_ptr to shared state between all instances of this reference.
check_handleWhether to have validation additionally check if a handle is not null
validateWhether to check the inputs and shared state for valid (and not errored) values

Definition at line 1464 of file afio.hpp.

boost::afio::future< void >::future ( handle_ptr  _handle,
bool  check_handle = true,
bool  validate = true 
)

Constructs an instance.

Parameters:
_handleA shared_ptr to shared state between all instances of this reference.
check_handleWhether to have validation additionally check if a handle is not null
validateWhether to check the inputs and shared state for valid (and not errored) values

Definition at line 1470 of file afio.hpp.

boost::afio::future< void >::future ( dispatcher parent,
size_t  id 
)

Constructs an instance.

Parameters:
parentThe dispatcher this op belongs to.
idThe unique non-zero id of this op.

Definition at line 1475 of file afio.hpp.


Member Function Documentation

future& boost::afio::future< void >::operator= ( const future< void > &  o)

Copy assignment.

Definition at line 1477 of file afio.hpp.

future& boost::afio::future< void >::operator= ( future< void > &&  o)

Move assignment.

Definition at line 1479 of file afio.hpp.

bool boost::afio::future< void >::valid ( ) const

True if this future is valid.

Definition at line 1482 of file afio.hpp.

boost::afio::future< void >::operator bool ( ) const [explicit]

Same as `true_(tribool(*this))`.

Definition at line 1484 of file afio.hpp.

bool boost::afio::future< void >::is_ready ( ) const

True if monad is not empty.

Definition at line 1486 of file afio.hpp.

bool boost::afio::future< void >::has_value ( ) const

True if monad contains a value_type.

Definition at line 1491 of file afio.hpp.

bool boost::afio::future< void >::has_error ( ) const

True if monad contains an error_type.

Definition at line 1493 of file afio.hpp.

bool boost::afio::future< void >::has_exception ( bool  only_exception = false) const

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.

Definition at line 1504 of file afio.hpp.

dispatcher* boost::afio::future< void >::parent ( ) const

The parent dispatcher of this future.

Definition at line 1512 of file afio.hpp.

size_t boost::afio::future< void >::id ( ) const

Definition at line 1514 of file afio.hpp.

handle_ptr boost::afio::future< void >::get_handle ( bool  return_null_if_errored = false) const

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

Definition at line 1516 of file afio.hpp.

handle_ptr boost::afio::future< void >::get_handle ( error_type &  ec) const

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.

Definition at line 1527 of file afio.hpp.

const handle& boost::afio::future< void >::operator* ( ) const

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

Definition at line 1535 of file afio.hpp.

handle& boost::afio::future< void >::operator* ( )

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

Definition at line 1537 of file afio.hpp.

const handle* boost::afio::future< void >::operator-> ( ) const

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

Definition at line 1539 of file afio.hpp.

handle* boost::afio::future< void >::operator-> ( )

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

Definition at line 1541 of file afio.hpp.

void boost::afio::future< void >::get ( )

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

Definition at line 1543 of file afio.hpp.

error_type boost::afio::future< void >::get_error ( ) const

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

Definition at line 1550 of file afio.hpp.

exception_type boost::afio::future< void >::get_exception ( ) const

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

Definition at line 1573 of file afio.hpp.

void boost::afio::future< void >::wait ( ) const

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

Definition at line 1580 of file afio.hpp.

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

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

Definition at line 1587 of file afio.hpp.

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

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

Definition at line 1594 of file afio.hpp.

template<class U >
auto boost::afio::future< void >::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.

Definition at line 1601 of file afio.hpp.

bool boost::afio::future< void >::validate ( bool  check_handle = true) const

Validates contents.

Definition at line 1608 of file afio.hpp.


January, 2014

Copyright © 2013-2014 Niall Douglas, Cork, Ireland
Copyright © 2013 Paul Kirth, California
Documentation is generated by Doxygen