Boost.AFIO    Boost C++ Libraries
Classes | Functions
dispatcher

Classes

class  boost::afio::current_dispatcher_guard

Functions

BOOST_AFIO_DECL dispatcher_ptr boost::afio::current_dispatcher (option< dispatcher_ptr > new_dispatcher=empty)
 Retrieves the currently set async_file_io_dispatcher for this thread, optionally setting it to a new dispatcher.
BOOST_AFIO_DECL outcome
< dispatcher_ptr > 
boost::afio::make_dispatcher (std::string uri="file : / / /", file_flags flagsforce=file_flags::none, file_flags flagsmask=file_flags::none, std::shared_ptr< thread_source > threadpool=process_threadpool()) noexcept
 Instatiates the best available async_file_io_dispatcher implementation for this system for the given uri.
future boost::afio::depends (future<> precondition, future<> out)
 Make ready a future after a precondition future readies.

Function Documentation

BOOST_AFIO_DECL dispatcher_ptr boost::afio::current_dispatcher ( option< dispatcher_ptr >  new_dispatcher = empty)

Retrieves the currently set async_file_io_dispatcher for this thread, optionally setting it to a new dispatcher.

Returns:
The current async_file_io_dispatcher.
Parameters:
new_dispatcherThe new async_file_io_dispatcher to set.
BOOST_AFIO_DECL outcome<dispatcher_ptr> boost::afio::make_dispatcher ( std::string  uri = "file : / / /",
file_flags  flagsforce = file_flags::none,
file_flags  flagsmask = file_flags::none,
std::shared_ptr< thread_source >  threadpool = process_threadpool() 
)

Instatiates the best available async_file_io_dispatcher implementation for this system for the given uri.

Note that the number of threads in the threadpool supplied is the maximum non-async op queue depth (e.g. file opens, closes etc.). For fast SSDs, there isn't much gain after eight-sixteen threads, so the process threadpool is set to eight by default. For slow hard drives, or worse, SANs, a queue depth of 64 or higher might deliver significant benefits.

URIs currently supported by AFIO:

  • `__fileurl__` The dispatcher will refer to the local filesystem of this machine.
Returns:
A shared_ptr to the best available async_file_io_dispatcher implementation for this system for the given uri.
Parameters:
uriWhere to open the dispatcher upon.
flagsforceThe flags to bitwise OR with any opened file flags. Used to force on certain flags.
flagsmaskThe flags to bitwise AND with any opened file flags. Used to force off certain flags.
threadpoolThe threadpool instance to use for asynchronous dispatch.
future boost::afio::depends ( future<>  precondition,
future<>  out 
)

Make ready a future after a precondition future readies.

Returns:
A future which returns out after precondition signals.
Parameters:
preconditionThe future which must signal before the returned future signals.
outThe future to return.

Definition at line 5738 of file afio.hpp.


January, 2014

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