Boost.AFIO    Boost C++ Libraries
Public Member Functions | Protected Member Functions | Friends
boost::afio::dispatcher Class Reference

Abstract base class for dispatching file i/o asynchronously. More...

List of all members.

Public Member Functions

void testing_flags (detail::unit_testing_flags flags)
virtual ~dispatcher ()
 Destroys the dispatcher, blocking inefficiently if any ops are still in flight.
std::shared_ptr< thread_sourcethreadsource () const
 Returns the thread source used by this dispatcher.
file_flags fileflags (file_flags flags) const
 Returns file flags as would be used after forcing and masking bits passed during construction.
size_t wait_queue_depth () const
 Returns the current wait queue depth of this dispatcher.
size_t fd_count () const
 Returns the number of open items in this dispatcher.
virtual std::vector< future<> > dir (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous directory creations and opens after optional preconditions.
virtual std::vector< future<> > rmdir (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous directory deletions after optional preconditions.
virtual std::vector< future<> > file (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous file creations and opens after optional preconditions.
virtual std::vector< future<> > rmfile (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous file deletions after optional preconditions.
virtual std::vector< future<> > symlink (const std::vector< path_req > &reqs, const std::vector< future<>> &targets=std::vector< future<>>())=0
 Schedule a batch of asynchronous symlink creations and opens after a precondition.
virtual std::vector< future<> > rmsymlink (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous symlink deletions after optional preconditions.
virtual std::vector< future<> > sync (const std::vector< future<>> &ops)=0
 Schedule a batch of asynchronous content synchronisations with physical storage after preceding operations.
virtual std::vector< future<> > zero (const std::vector< future<>> &ops, const std::vector< std::vector< std::pair< off_t, off_t >>> &ranges)=0
 Schedule a batch of asynchronous zeroing and deallocations of physical storage ("hole punching") after preceding operations.
virtual std::vector< future<> > close (const std::vector< future<>> &ops)=0
 Schedule a batch of asynchronous file or directory handle closes after preceding operations.
template<class T >
virtual std::vector< future<> > read (const std::vector< io_req< T >> &ops)=0
 Schedule a batch of asynchronous data reads after preceding operations, where offset and total data read must not exceed the present file size.
template<class T >
virtual std::vector< future<> > write (const std::vector< io_req< const T >> &ops)=0
 Schedule a batch of asynchronous data writes after preceding operations, where offset and total data written must not exceed the present file size.
virtual std::vector< future<> > truncate (const std::vector< future<>> &ops, const std::vector< off_t > &sizes)=0
 Schedule a batch of asynchronous file length truncations after preceding operations.
virtual std::vector< future
< std::pair< std::vector
< directory_entry >, bool > > > 
enumerate (const std::vector< enumerate_req > &reqs)=0
 Schedule a batch of asynchronous directory enumerations after preceding operations.
virtual std::vector< future
< std::vector< std::pair
< off_t, off_t > > > > 
extents (const std::vector< future<>> &ops)=0
 Schedule a batch of asynchronous extent enumerations after preceding operations.
virtual std::vector< future
< statfs_t > > 
statfs (const std::vector< future<>> &ops, const std::vector< fs_metadata_flags > &reqs)=0
 Schedule a batch of asynchronous volume enumerations after preceding operations.
future depends (future<> precondition, future<> op)
 Schedule the return of an op handle after another op handle completes. This is useful when you need to supply one op handle to a function but it must not begin until another op handle has finished.
void complete_async_op (size_t id, handle_ptr h, exception_ptr e=exception_ptr())
 Completes an operation with a handle or an error, usually used when an operation was previously deferred.
void complete_async_op (size_t id, exception_ptr e)
 Completes an operation with an error, usually used when an operation was previously deferred.
template<class T >
std::vector< future<> > write (const std::vector< io_req< T >> &ops)

Protected Member Functions

 dispatcher (std::shared_ptr< thread_source > threadpool, file_flags flagsforce, file_flags flagsmask)
std::pair< bool, handle_ptr > doadopt (size_t, future<>, handle_ptr h)
template<class F >
handle_ptr int_get_handle_to_containing_dir (F *parent, size_t id, path_req req, completion_returntype(F::*dofile)(size_t, future<>, path_req))
completion_returntype invoke_user_completion_fast (size_t id, future<> h, completion_t *callback)
completion_returntype invoke_user_completion_slow (size_t id, future<> h, std::function< completion_t > callback)
template<class F >
std::vector< future<> > chain_async_ops (int optype, const std::vector< future<>> &preconditions, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, future<>))
template<class F , class T >
std::vector< future<> > chain_async_ops (int optype, const std::vector< future<>> &preconditions, const std::vector< T > &container, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, T))
template<class R , class F >
std::vector< future< R > > chain_async_ops (int optype, const std::vector< future<>> &preconditions, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, std::shared_ptr< promise< R >>))
template<class R , class F , class T >
std::vector< future< R > > chain_async_ops (int optype, const std::vector< future<>> &preconditions, const std::vector< T > &container, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, T, std::shared_ptr< promise< R >>))
template<class F , class T >
std::vector< future<> > chain_async_ops (int optype, const std::vector< T > &container, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, T))
template<class R , class F , class T >
std::vector< future< R > > chain_async_ops (int optype, const std::vector< T > &container, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, T, std::shared_ptr< promise< R >>))
template<class T >
dispatcher::completion_returntype dobarrier (size_t id, future<> h, T)
template<class F , class... Args>
handle_ptr invoke_async_op_completions (size_t id, future<> h, completion_returntype(F::*f)(size_t, future<>, Args...), Args...args)
template<class F , class... Args>
future chain_async_op (detail::immediate_async_ops &immediates, int optype, const future<> &precondition, async_op_flags flags, completion_returntype(F::*f)(size_t, future<>, Args...), Args...args)

Friends

struct detail::async_io_handle_posix
struct detail::async_io_handle_windows
class detail::async_file_io_dispatcher_compat
class detail::async_file_io_dispatcher_windows
class detail::async_file_io_dispatcher_linux
class detail::async_file_io_dispatcher_qnx
template<class Impl , class Handle >
handle_ptr detail::decode_relative_path (path_req &req, bool force_absolute)

Detailed Description

Abstract base class for dispatching file i/o asynchronously.

This is a reference counted instance with platform-specific implementation in object code. Construct an instance using the `boostafio::make_dispatcher()` function.

Definition at line 1811 of file afio.hpp.


Constructor & Destructor Documentation

virtual boost::afio::dispatcher::~dispatcher ( ) [virtual]

Destroys the dispatcher, blocking inefficiently if any ops are still in flight.


Member Function Documentation

Returns the thread source used by this dispatcher.

Returns file flags as would be used after forcing and masking bits passed during construction.

Returns the current wait queue depth of this dispatcher.

Returns the number of open items in this dispatcher.


January, 2014

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