Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PTL::TaskFuture< RetT > Class Template Referenceabstract

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

#include <Task.hh>

+ Inheritance diagram for PTL::TaskFuture< RetT >:

Public Types

using promise_type = std::promise< RetT >
 
using future_type = std::future< RetT >
 
using result_type = RetT
 
- Public Types inherited from PTL::VTask
using tid_type = std::thread::id
 
using size_type = size_t
 
using void_func_t = std::function< void()>
 

Public Member Functions

template<typename... Args>
 TaskFuture (Args &&... args)
 
 ~TaskFuture () override=default
 
 TaskFuture (const TaskFuture &)=delete
 
TaskFutureoperator= (const TaskFuture &)=delete
 
 TaskFuture (TaskFuture &&) noexcept=default
 
TaskFutureoperator= (TaskFuture &&) noexcept=default
 
virtual future_type get_future ()=0
 
virtual void wait ()=0
 
virtual RetT get ()=0
 
- Public Member Functions inherited from PTL::VTask
 VTask (bool _is_native, intmax_t _depth)
 
 VTask ()=default
 
virtual ~VTask ()=default
 
 VTask (const VTask &)=delete
 
VTaskoperator= (const VTask &)=delete
 
 VTask (VTask &&)=default
 
VTaskoperator= (VTask &&)=default
 
virtual void operator() ()=0
 
bool is_native_task () const
 
intmax_t depth () const
 

Additional Inherited Members

- Protected Attributes inherited from PTL::VTask
bool m_is_native = false
 
intmax_t m_depth = 0
 
void_func_t m_func = []() {}
 

Detailed Description

template<typename RetT>
class PTL::TaskFuture< RetT >

The task class is supplied to thread_pool.

Definition at line 47 of file Task.hh.

Member Typedef Documentation

◆ future_type

template<typename RetT >
using PTL::TaskFuture< RetT >::future_type = std::future<RetT>

Definition at line 51 of file Task.hh.

◆ promise_type

template<typename RetT >
using PTL::TaskFuture< RetT >::promise_type = std::promise<RetT>

Definition at line 50 of file Task.hh.

◆ result_type

template<typename RetT >
using PTL::TaskFuture< RetT >::result_type = RetT

Definition at line 52 of file Task.hh.

Constructor & Destructor Documentation

◆ TaskFuture() [1/3]

template<typename RetT >
template<typename... Args>
PTL::TaskFuture< RetT >::TaskFuture ( Args &&...  args)
inline

Definition at line 57 of file Task.hh.

58 : VTask{ std::forward<Args>(args)... }
59 {}
VTask()=default

◆ ~TaskFuture()

template<typename RetT >
PTL::TaskFuture< RetT >::~TaskFuture ( )
overridedefault

◆ TaskFuture() [2/3]

template<typename RetT >
PTL::TaskFuture< RetT >::TaskFuture ( const TaskFuture< RetT > &  )
delete

◆ TaskFuture() [3/3]

template<typename RetT >
PTL::TaskFuture< RetT >::TaskFuture ( TaskFuture< RetT > &&  )
defaultnoexcept

Member Function Documentation

◆ get()

template<typename RetT >
virtual RetT PTL::TaskFuture< RetT >::get ( )
pure virtual

◆ get_future()

template<typename RetT >
virtual future_type PTL::TaskFuture< RetT >::get_future ( )
pure virtual

◆ operator=() [1/2]

template<typename RetT >
TaskFuture & PTL::TaskFuture< RetT >::operator= ( const TaskFuture< RetT > &  )
delete

◆ operator=() [2/2]

template<typename RetT >
TaskFuture & PTL::TaskFuture< RetT >::operator= ( TaskFuture< RetT > &&  )
defaultnoexcept

◆ wait()

template<typename RetT >
virtual void PTL::TaskFuture< RetT >::wait ( )
pure virtual

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