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_adaptor< Executor > Class Template Reference

Polymorphic adaptor of a model of Executor to an executor. More...

#include <executor_adaptor.hpp>

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

Public Types

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

Public Member Functions

template<typename... Args>
 executor_adaptor (BOOST_THREAD_RV_REF(Args)...args)
 executor is not copyable. More...
 
Executor & underlying_executor ()
 
void close ()
 Effects: close the executor for submissions. More...
 
bool closed ()
 Returns: whether the pool is closed for submissions. More...
 
void submit (BOOST_THREAD_RV_REF(work) closure)
 Effects: The specified closure will be scheduled for execution at some point in the future. More...
 
void submit (void(*closure)())
 
template<typename Closure >
void submit (BOOST_THREAD_RV_REF(Closure) closure)
 
bool try_executing_one ()
 Effects: try to execute one task. More...
 
template<typename Pred >
bool reschedule_until (Pred const &pred)
 

Detailed Description

template<typename Executor>
class boost::executors::executor_adaptor< Executor >

Polymorphic adaptor of a model of Executor to an executor.

Member Typedef Documentation

template<typename Executor >
typedef executor::work boost::executors::executor_adaptor< Executor >::work

type-erasure to store the works to do

Constructor & Destructor Documentation

template<typename Executor >
template<typename... Args>
boost::executors::executor_adaptor< Executor >::executor_adaptor ( BOOST_THREAD_RV_REF(Args)...  args)
inline

executor is not copyable.

executor_adaptor constructor

Member Function Documentation

template<typename Executor >
void boost::executors::executor_adaptor< 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<typename Executor >
bool boost::executors::executor_adaptor< 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<typename Executor >
void boost::executors::executor_adaptor< 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: 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.

Implements boost::executors::executor.

References boost::move().

Referenced by boost::executors::executor_adaptor< Executor >::submit().

template<typename Executor >
void boost::executors::executor_adaptor< Executor >::submit ( void(*)()  closure)
inline
template<typename Executor >
template<typename Closure >
void boost::executors::executor_adaptor< Executor >::submit ( BOOST_THREAD_RV_REF(Closure)  closure)
inline
template<typename Executor >
bool boost::executors::executor_adaptor< 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.

template<typename Executor >
Executor& boost::executors::executor_adaptor< Executor >::underlying_executor ( )
inline

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