ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::taskDelegator::task< TYPE > Class Template Referencefinal

Concrete task implementation with future/promise support. More...

#include <tasks.h>

Inheritance diagram for original::taskDelegator::task< TYPE >:
Inheritance graph
Collaboration diagram for original::taskDelegator::task< TYPE >:
Collaboration graph

Public Member Functions

 task (const task &)=delete
 Disable copy constructor.
 
taskoperator= (const task &)=delete
 Disable copy assignment.
 
 task (task &&)=default
 Allow move constructor.
 
taskoperator= (task &&)=default
 Allow move assignment.
 
template<typename Callback , typename... Args>
 task (Callback &&c, Args &&... args)
 Constructs a task from a callable and its arguments.
 
void run () override
 Executes the task.
 
async::future< TYPEgetFuture ()
 Gets the future associated with this task.
 
- Public Member Functions inherited from original::taskDelegator::taskBase
virtual ~taskBase ()=default
 Virtual destructor for proper polymorphic behavior.
 

Detailed Description

template<typename TYPE>
class original::taskDelegator::task< TYPE >

Concrete task implementation with future/promise support.

Template Parameters
TYPEReturn type of the task

Wraps a callable and its arguments, and provides integration with futures.

Constructor & Destructor Documentation

◆ task()

template<typename TYPE >
template<typename Callback , typename... Args>
original::taskDelegator::task< TYPE >::task ( Callback &&  c,
Args &&...  args 
)
explicit

Constructs a task from a callable and its arguments.

Template Parameters
CallbackCallable type
ArgsArgument types
Parameters
cCallable to execute
argsArguments for the callable

Member Function Documentation

◆ getFuture()

Gets the future associated with this task.

Returns
Future object for the task result

◆ run()

template<typename TYPE >
void original::taskDelegator::task< TYPE >::run ( )
overridevirtual

Executes the task.

Implements original::taskDelegator::taskBase.


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