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<> &rFuture)
 
 CYITask (std::unique_ptr< CYIFuture<>> pFuture)
 
virtual ~CYITask ()
 
bool SetFuture (CYIFuture<> &rFuture)
 
bool SetFuture (std::unique_ptr< CYIFuture<>> pFuture)
 
- Public Member Functions inherited from CYITaskBase
virtual ~CYITaskBase ()
 
virtual bool TakeOwnershipOfFuture (std::unique_ptr< CYIAbstractFuture > pFuture)
 
TASK_STATE GetState () const
 
bool IsFutureOwner () const
 
bool MarkPendingExecution ()
 
void RequestCancellation ()
 
bool Execute ()
 

Protected Member Functions

virtual void Run ()=0
 
- Protected Member Functions inherited from CYITaskBase
bool IsCancellationRequested () const
 
void SetCancellationRequestSucceeded ()
 
virtual void CleanUpAfterCancellation ()
 

Additional Inherited Members

- Public Types inherited from CYITaskBase
enum  TASK_STATE {
  TASK_NEW,
  TASK_PENDING_EXECUTION,
  TASK_EXECUTING,
  TASK_COMPLETED,
  TASK_CANCELLED
}
 
- Protected Attributes inherited from CYITaskBase
CYIMutex m_mutex
 

Constructor & Destructor Documentation

CYITask<>::CYITask ( )
CYITask<>::CYITask ( CYIFuture<> &  rFuture)
CYITask<>::CYITask ( std::unique_ptr< CYIFuture<>>  pFuture)
virtual CYITask<>::~CYITask ( )
virtual

Member Function Documentation

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

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

bool CYITask<>::SetFuture ( CYIFuture<> &  rFuture)

Creates an association between the provided Future object and this Task. If a Future object is already associated with this Task, this function does nothing. If the provided Future object already has an associated task, this function does nothing.

Note
Associatations with Future objects can only be done prior to execution of the task and prior to enqueing the task in a task executor.
Returns
Returns true if the provided Future object was successfully associated with this Task.
bool CYITask<>::SetFuture ( std::unique_ptr< CYIFuture<>>  pFuture)

Creates an association between the provided Future object and this Task, and transfers ownership of the future object to this task. If a Future object is already associated with this Task, the provided future object is deleted. If the provided Future object already has an associated task, the provided future object is deleted.

Note
Associatations with Future objects can only be done prior to execution of the task and prior to enqueing the task in a task executor.
Returns
Returns true if the provided Future object was successfully associated with this Task.

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