Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::executors::executor_ref< Executor > Class Template Reference

#include <generic_executor_ref.hpp>

Inheritance diagram for boost::executors::executor_ref< Executor >:
Collaboration diagram for boost::executors::executor_ref< Executor >:

Public Types

typedef executors::work work
 type-erasure to store the works to do More...
 

Public Member Functions

 executor_ref (Executor &ex)
 executor is not copyable. More...
 
 ~executor_ref ()
 
void close ()
 
bool closed ()
 
void submit (BOOST_THREAD_RV_REF(work) closure)
 
bool try_executing_one ()
 
void submit (void(*closure)())
 
template<typename Closure >
void submit (BOOST_THREAD_RV_REF(Closure) closure)
 
template<typename Pred >
bool reschedule_until (Pred const &pred)
 

Member Typedef Documentation

template<class Executor >
typedef executors::work boost::executors::executor_ref< Executor >::work

type-erasure to store the works to do

Constructor & Destructor Documentation

template<class Executor >
boost::executors::executor_ref< Executor >::executor_ref ( Executor &  ex)
inline

executor is not copyable.

template<class Executor >
boost::executors::executor_ref< Executor >::~executor_ref ( )
inline
Effects
Destroys the executor.
Synchronization
The completion of all the closures happen before the completion of the executor destructor.

Member Function Documentation

template<class Executor >
void boost::executors::executor_ref< Executor >::close ( )
inlinevirtual
Effects
Close the executor for submissions. The worker threads will work until there is no more closures to run.

Implements boost::executors::executor.

template<class Executor >
bool boost::executors::executor_ref< Executor >::closed ( )
inlinevirtual
Returns
Whether the pool is closed for submissions.

Implements boost::executors::executor.

template<typename Pred >
bool boost::executors::executor::reschedule_until ( Pred const &  pred)
inlineinherited
Requires
This must be called from an scheduled task.
Effects
Reschedule functions until pred()

References boost::executors::executor::try_executing_one().

template<class Executor >
void boost::executors::executor_ref< Executor >::submit ( BOOST_THREAD_RV_REF(work closure)
inlinevirtual
Effects
The specified closure will be scheduled for execution at some point in the future. If invoked closure throws an exception the executor will call std::terminate, as is the case with threads.
Synchronization
Ccompletion of closure on a particular thread happens before destruction of thread's thread local variables.
Throws
sync_queue_is_closed if the thread pool is closed. Whatever exception that can be throw while storing the closure.

Implements boost::executors::executor.

References boost::move().

void boost::executors::executor::submit ( void(*)()  closure)
inlineinherited
Requires
Closure is a model of Callable(void()) and a model of CopyConstructible/MoveConstructible.
Effects
The specified closure will be scheduled for execution at some point in the future. If invoked closure throws an exception the thread pool will call std::terminate, as is the case with threads.
Synchronization
Completion of closure on a particular thread happens before destruction of thread's thread local variables.
Throws
sync_queue_is_closed if the thread pool is closed. Whatever exception that can be throw while storing the closure.

References boost::move(), and boost::executors::executor::submit().

template<typename Closure >
void boost::executors::executor::submit ( BOOST_THREAD_RV_REF(Closure)  closure)
inlineinherited
template<class Executor >
bool boost::executors::executor_ref< Executor >::try_executing_one ( )
inlinevirtual
Effects
Try to execute one task.
Returns
Whether a task has been executed.
Throws
Whatever the current task constructor throws or the task() throws.

Implements boost::executors::executor.


The documentation for this class was generated from the following file: