You.i Engine
CYITask<> Class Template Referenceabstract

Detailed Description

template<>
class CYITask<>

Void specialization of CYITask. This task does not return a value when executed.

See also
CYITask<ResultType>

#include <thread/YiTask.h>

Inheritance diagram for CYITask<>:

Public Member Functions

 CYITask ()
 
 CYITask (CYIFuture<> future)
 
bool SetFuture (CYIFuture<> future)
 
- Public Member Functions inherited from CYITaskBase
virtual ~CYITaskBase ()
 
State GetState () const
 
bool MarkPendingExecution ()
 
void RequestCancellation ()
 
bool IsCancellationRequested () const
 
void SetCancellationRequestSucceeded ()
 
bool IsCancellationRequestSucceeded () const
 
bool Execute ()
 

Protected Member Functions

virtual void Run ()=0
 

Additional Inherited Members

- Public Types inherited from CYITaskBase
enum  State : uint8_t {
  State::New,
  State::PendingExecution,
  State::Executing,
  State::Completed,
  State::Cancelled
}
 

Constructor & Destructor Documentation

◆ CYITask() [1/2]

CYITask<>::CYITask ( )

◆ CYITask() [2/2]

CYITask<>::CYITask ( CYIFuture<>  future)
explicit

Member Function Documentation

◆ Run()

virtual void CYITask<>::Run ( )
protectedpure virtual

The function executed by this task. Implement this function in a sub-classe to implement your own task.

◆ SetFuture()

bool CYITask<>::SetFuture ( CYIFuture<>  future)

Creates an association between the provided CYIFuture object and this CYITask. If a CYIFuture object is already associated with this CYITask, this function does nothing and false is returned. If the provided CYIFuture object already has an associated task, this function does nothing and false is returned.

Note
Associatations with CYIFuture objects can only be done prior to execution of the task and prior to enqueing the task in a task executor.
Warning
This function is not threadsafe.
Returns
Returns true if the provided CYIFuture object was successfully associated with this Task.

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