Geant4  10.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Task< void, void > Class Template Reference

The task class is supplied to thread_pool. More...

Inheritance diagram for Task< void, void >:
VTask

Public Types

typedef void RetT
 
typedef Task< void, voidthis_type
 
typedef std::promise< RetTpromise_type
 
typedef std::future< RetTfuture_type
 
typedef std::packaged_task< RetT()> packaged_task_type
 
typedef RetT result_type
 
- Public Types inherited from VTask
typedef std::thread::id tid_type
 
typedef size_t size_type
 
typedef VTask this_type
 
typedef std::atomic_uintmax_t count_t
 
typedef VTaskiterator
 
typedef const VTaskconst_iterator
 
typedef std::function< void()> void_func_t
 

Public Member Functions

template<typename FuncT >
 Task (FuncT &&func)
 
template<typename FuncT >
 Task (VTaskGroup *tg, FuncT &&func)
 
template<typename FuncT >
 Task (ThreadPool *tp, FuncT &&func)
 
virtual ~Task ()
 
virtual void operator() () final
 
virtual bool is_native_task () const override
 
future_type get_future ()
 
- Public Member Functions inherited from VTask
 VTask ()
 
 VTask (VTaskGroup *task_group)
 
 VTask (ThreadPool *pool)
 
virtual ~VTask ()
 
void operator-- ()
 
virtual ThreadPoolpool () const
 
VTaskGroupgroup () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
intmax_t & depth ()
 
const intmax_t & depth () const
 

Private Attributes

packaged_task_type m_ptask
 

Additional Inherited Members

- Static Protected Member Functions inherited from VTask
static tid_type this_tid ()
 
- Protected Attributes inherited from VTask
intmax_t m_depth
 
VTaskGroupm_group
 
ThreadPoolm_pool
 
void_func_t m_func = []() {}
 

Detailed Description

template<>
class PTL::Task< void, void >

The task class is supplied to thread_pool.

Member Typedef Documentation

typedef void RetT
typedef Task<void, void> this_type
typedef std::promise<RetT> promise_type
typedef std::future<RetT> future_type
typedef std::packaged_task<RetT()> packaged_task_type
typedef RetT result_type

Constructor & Destructor Documentation

Task ( FuncT &&  func)
explicit
Task ( VTaskGroup tg,
FuncT &&  func 
)
Task ( ThreadPool tp,
FuncT &&  func 
)
virtual ~Task ( )
virtual

Member Function Documentation

virtual void operator() ( )
finalvirtual
virtual bool is_native_task ( ) const
overridevirtual

Reimplemented from VTask.

future_type get_future ( )

Member Data Documentation

packaged_task_type m_ptask
private