Clementine
|
Polymorphic wrapper for executors. More...
#include <executor.hpp>
Classes | |
class | impl< system_executor, Allocator > |
struct | unspecified_bool_type_t |
Public Types | |
typedef void(* | unspecified_bool_type) (unspecified_bool_type_t) |
Public Member Functions | |
executor () ASIO_NOEXCEPT | |
Default constructor. | |
executor (nullptr_t) ASIO_NOEXCEPT | |
Construct from nullptr. | |
executor (const executor &other) ASIO_NOEXCEPT | |
Copy constructor. | |
template<typename Executor > | |
executor (Executor e) | |
Construct a polymorphic wrapper for the specified executor. | |
template<typename Executor , typename Allocator > | |
executor (allocator_arg_t, const Allocator &a, Executor e) | |
Allocator-aware constructor to create a polymorphic wrapper for the specified executor. More... | |
~executor () | |
Destructor. | |
executor & | operator= (const executor &other) ASIO_NOEXCEPT |
Assignment operator. | |
executor & | operator= (nullptr_t) ASIO_NOEXCEPT |
Assignment operator for nullptr_t. | |
template<typename Executor > | |
executor & | operator= (ASIO_MOVE_ARG(Executor) e) ASIO_NOEXCEPT |
Assignment operator to create a polymorphic wrapper for the specified executor. More... | |
execution_context & | context () const ASIO_NOEXCEPT |
Obtain the underlying execution context. | |
void | on_work_started () const ASIO_NOEXCEPT |
Inform the executor that it has some outstanding work to do. | |
void | on_work_finished () const ASIO_NOEXCEPT |
Inform the executor that some work is no longer outstanding. | |
template<typename Function , typename Allocator > | |
void | dispatch (ASIO_MOVE_ARG(Function) f, const Allocator &a) const |
Request the executor to invoke the given function object. More... | |
template<typename Function , typename Allocator > | |
void | post (ASIO_MOVE_ARG(Function) f, const Allocator &a) const |
Request the executor to invoke the given function object. More... | |
template<typename Function , typename Allocator > | |
void | defer (ASIO_MOVE_ARG(Function) f, const Allocator &a) const |
Request the executor to invoke the given function object. More... | |
operator unspecified_bool_type () const ASIO_NOEXCEPT | |
Operator to test if the executor contains a valid target. | |
const std::type_info & | target_type () const ASIO_NOEXCEPT |
Obtain type information for the target executor object. More... | |
template<typename Executor > | |
Executor * | target () ASIO_NOEXCEPT |
Obtain a pointer to the target executor object. More... | |
template<typename Executor > | |
const Executor * | target () const ASIO_NOEXCEPT |
Obtain a pointer to the target executor object. More... | |
Static Public Member Functions | |
static void | unspecified_bool_true (unspecified_bool_type_t) |
Friends | |
bool | operator== (const executor &a, const executor &b) ASIO_NOEXCEPT |
Compare two executors for equality. | |
bool | operator!= (const executor &a, const executor &b) ASIO_NOEXCEPT |
Compare two executors for inequality. | |
Polymorphic wrapper for executors.
executor::executor | ( | allocator_arg_t | , |
const Allocator & | a, | ||
Executor | e | ||
) |
Allocator-aware constructor to create a polymorphic wrapper for the specified executor.
void executor::defer | ( | ASIO_MOVE_ARG(Function) | f, |
const Allocator & | a | ||
) | const |
Request the executor to invoke the given function object.
This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object.
f | The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: void function(); |
a | An allocator that may be used by the executor to allocate the internal storage needed for function invocation. |
void executor::dispatch | ( | ASIO_MOVE_ARG(Function) | f, |
const Allocator & | a | ||
) | const |
Request the executor to invoke the given function object.
This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object.
f | The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: void function(); |
a | An allocator that may be used by the executor to allocate the internal storage needed for function invocation. |
|
inline |
Assignment operator to create a polymorphic wrapper for the specified executor.
void executor::post | ( | ASIO_MOVE_ARG(Function) | f, |
const Allocator & | a | ||
) | const |
Request the executor to invoke the given function object.
This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object.
f | The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: void function(); |
a | An allocator that may be used by the executor to allocate the internal storage needed for function invocation. |
Executor * executor::target | ( | ) |
Obtain a pointer to the target executor object.
target_type() == typeid(T)
, a pointer to the stored executor target; otherwise, a null pointer. const Executor * executor::target | ( | ) | const |
Obtain a pointer to the target executor object.
target_type() == typeid(T)
, a pointer to the stored executor target; otherwise, a null pointer.
|
inline |
Obtain type information for the target executor object.
*this
has a target type of type T
, typeid(T)
; otherwise, typeid(void)
.