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 Class Referenceabstract

#include <executor.hpp>

Inheritance diagram for boost::executors::executor:

Public Types

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

Public Member Functions

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

Member Typedef Documentation

type-erasure to store the works to do

Constructor & Destructor Documentation

boost::executors::executor::executor ( )
inline

executor is not copyable.

virtual boost::executors::executor::~executor ( )
inlinevirtual
Effects
Destroys the executor.
Synchronization
The completion of all the closures happen before the completion of the executor destructor.

Member Function Documentation

virtual void boost::executors::executor::close ( )
pure virtual
Effects
Close the executor for submissions. The worker threads will work until there is no more closures to run.

Implemented in boost::executors::executor_adaptor< Executor >, and boost::executors::executor_ref< Executor >.

virtual bool boost::executors::executor::closed ( )
pure virtual
Returns
Whether the pool is closed for submissions.

Implemented in boost::executors::executor_adaptor< Executor >, and boost::executors::executor_ref< Executor >.

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

References try_executing_one().

virtual void boost::executors::executor::submit ( BOOST_THREAD_RV_REF(work closure)
pure virtual
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.

Implemented in boost::executors::executor_adaptor< Executor >, and boost::executors::executor_ref< Executor >.

Referenced by submit().

void boost::executors::executor::submit ( void(*)()  closure)
inline
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 submit().

template<typename Closure >
void boost::executors::executor::submit ( BOOST_THREAD_RV_REF(Closure)  closure)
inline

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

virtual bool boost::executors::executor::try_executing_one ( )
pure virtual
Effects
Try to execute one task.
Returns
Whether a task has been executed.
Throws
Whatever the current task constructor throws or the task() throws.

Implemented in boost::executors::executor_adaptor< Executor >, and boost::executors::executor_ref< Executor >.

Referenced by reschedule_until().


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