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

Abstract base class for a source of thread workers. More...

Inheritance diagram for boost::afio::thread_source:
boost::afio::std_thread_pool

List of all members.

Public Member Functions

asio::io_service & io_service ()
 Returns the underlying io_service.
template<class R >
void enqueue (enqueued_task< R > task)
 Sends a task to the thread pool for execution.
template<class F >
shared_future< typename
std::result_of< F()>::type > 
enqueue (F f)
 Sends some callable entity to the thread pool for execution.

Protected Member Functions

 thread_source (asio::io_service &_service)
thread_sourceoperator= (const thread_source &)

Protected Attributes

asio::io_service & service

Detailed Description

Abstract base class for a source of thread workers.

Note that in Boost 1.54, and possibly later versions, `asio::io_service` on Windows appears to dislike being destructed during static data deinit, hence why this inherits from `std::enable_shared_from_this<>` in order that it may be reference count deleted before static data deinit occurs.

Definition at line 260 of file afio.hpp.


Member Function Documentation

Returns the underlying io_service.

Definition at line 269 of file afio.hpp.

template<class R >
void boost::afio::thread_source::enqueue ( enqueued_task< R >  task)

Sends a task to the thread pool for execution.

Template Parameters:
class RThe return type of the enqueued task

Definition at line 271 of file afio.hpp.

template<class F >
shared_future<typename std::result_of<F()>::type> boost::afio::thread_source::enqueue ( f)

Sends some callable entity to the thread pool for execution.

Returns:
An enqueued task for the enqueued callable
Template Parameters:
class FAny callable type with signature R(void)
Parameters:
fAny instance of a callable type

Definition at line 276 of file afio.hpp.


January, 2014

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