HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Work_Dispatcher< Impl > Class Template Reference

#include <dispatcher.h>

+ Inheritance diagram for Work_Dispatcher< Impl >:

Public Member Functions

WORK_API ~Work_Dispatcher () noexcept
 Wait() for any pending tasks to complete, then destroy the dispatcher. More...
 
 Work_Dispatcher (Work_Dispatcher const &)=delete
 
Work_Dispatcheroperator= (Work_Dispatcher const &)=delete
 
template<class Callable >
void Run (Callable &&c)
 
template<class Callable , class A0 , class... Args>
void Run (Callable &&c, A0 &&a0, Args &&...args)
 
WORK_API void Wait ()
 Block until the work started by Run() completes. More...
 
WORK_API void Cancel ()
 
WORK_API bool IsCancelled () const
 

Protected Member Functions

WORK_API Work_Dispatcher ()
 

Detailed Description

template<class Impl>
class Work_Dispatcher< Impl >

Definition at line 32 of file dispatcher.h.

Constructor & Destructor Documentation

template<class Impl>
WORK_API Work_Dispatcher< Impl >::Work_Dispatcher ( )
protected
template<class Impl>
WORK_API Work_Dispatcher< Impl >::~Work_Dispatcher ( )
noexcept

Wait() for any pending tasks to complete, then destroy the dispatcher.

template<class Impl>
Work_Dispatcher< Impl >::Work_Dispatcher ( Work_Dispatcher< Impl > const &  )
delete

Member Function Documentation

template<class Impl>
WORK_API void Work_Dispatcher< Impl >::Cancel ( )

Cancel remaining work and return immediately.

Calling this function affects task that are being run directly by this dispatcher. If any of these tasks are using their own dispatchers to run tasks, these dispatchers will not be affected and these tasks will run to completion, unless they are also explicitly cancelled.

This call does not block. Call Wait() after Cancel() to wait for pending tasks to complete.

template<class Impl>
WORK_API bool Work_Dispatcher< Impl >::IsCancelled ( ) const

Returns true if Cancel() has been called. Calling Wait() will reset the cancel state.

template<class Impl>
Work_Dispatcher& Work_Dispatcher< Impl >::operator= ( Work_Dispatcher< Impl > const &  )
delete
template<class Impl>
template<class Callable >
void Work_Dispatcher< Impl >::Run ( Callable &&  c)
inline

Definition at line 63 of file dispatcher.h.

template<class Impl>
template<class Callable , class A0 , class... Args>
void Work_Dispatcher< Impl >::Run ( Callable &&  c,
A0 &&  a0,
Args &&...  args 
)
inline

Definition at line 78 of file dispatcher.h.

template<class Impl>
WORK_API void Work_Dispatcher< Impl >::Wait ( )

Block until the work started by Run() completes.


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