ORIGINAL
Loading...
Searching...
No Matches
original::task< TYPE > Class Template Referencefinal

Concrete task implementation with result type. More...

#include <tasks.h>

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

Public Member Functions

 task (const task &)=delete
 
taskoperator= (const task &)=delete
 
 task (task &&)=default
 
taskoperator= (task &&)=default
 
 task ()=default
 Default constructor.
 
template<typename Callback , typename... Args>
 task (Callback &&c, Args &&... args)
 Constructs a task with a callable and arguments.
 
void run () override
 Executes the task computation.
 
async::future< TYPE > getFuture ()
 Gets the future associated with this task.
 
- Public Member Functions inherited from original::taskBase
virtual ~taskBase ()=default
 Virtual destructor for proper polymorphism.
 

Detailed Description

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

Concrete task implementation with result type.

Template Parameters
TYPEThe return type of the task computation

Wraps a computation and provides future/promise integration

Constructor & Destructor Documentation

◆ task()

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

Constructs a task with a callable and arguments.

Template Parameters
CallbackType of the callable
ArgsTypes of the arguments
Parameters
cCallable to execute
argsArguments to forward to the callable

Member Function Documentation

◆ getFuture()

template<typename TYPE >
original::async::future< TYPE > original::task< TYPE >::getFuture ( )

Gets the future associated with this task.

Returns
A future that will receive the computation result

◆ run()

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

Executes the task computation.

Implements original::taskBase.


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