Embedded Multicore Building Blocks V1.0.0
Public Member Functions | List of all members
embb::mtapi::Task Class Reference

A Task represents a running Action of a specific Job. More...

#include <task.h>

Public Member Functions

 Task ()
 Constructs an invalid Task. More...
 
 Task (Task const &other)
 Copies a Task. More...
 
void operator= (Task const &other)
 Copies a Task. More...
 
 ~Task ()
 Destroys a Task. More...
 
mtapi_status_t Wait (mtapi_timeout_t timeout)
 Waits for Task to finish for timeout milliseconds. More...
 
mtapi_status_t Wait ()
 Waits for Task to finish. More...
 
void Cancel ()
 Signals the Task to cancel computation. More...
 
mtapi_task_hndl_t GetInternal () const
 Returns the internal representation of this object. More...
 

Detailed Description

A Task represents a running Action of a specific Job.

Constructor & Destructor Documentation

embb::mtapi::Task::Task ( )

Constructs an invalid Task.

Concurrency
Thread-safe and wait-free
embb::mtapi::Task::Task ( Task const &  other)

Copies a Task.

Concurrency
Thread-safe and wait-free
Parameters
otherThe task to copy.
embb::mtapi::Task::~Task ( )

Destroys a Task.

Concurrency
Thread-safe and wait-free

Member Function Documentation

void embb::mtapi::Task::operator= ( Task const &  other)

Copies a Task.

Concurrency
Thread-safe and wait-free
Parameters
otherThe task to copy.
mtapi_status_t embb::mtapi::Task::Wait ( mtapi_timeout_t  timeout)

Waits for Task to finish for timeout milliseconds.

Returns
The status of the finished Task, MTAPI_TIMEOUT or MTAPI_ERR_*
Concurrency
Thread-safe
Parameters
[in]timeoutTimeout duration in milliseconds
mtapi_status_t embb::mtapi::Task::Wait ( )

Waits for Task to finish.

Returns
The status of the finished Task or MTAPI_ERR_*
Concurrency
Thread-safe
void embb::mtapi::Task::Cancel ( )

Signals the Task to cancel computation.

Concurrency
Thread-safe and wait-free
mtapi_task_hndl_t embb::mtapi::Task::GetInternal ( ) const

Returns the internal representation of this object.

Allows for interoperability with the C interface.

Returns
The internal mtapi_task_hndl_t.
Concurrency
Thread-safe and wait-free