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

Contains attributes of a Task. More...

#include <task_attributes.h>

Public Member Functions

 TaskAttributes ()
 Constructs a TaskAttributes object. More...
 
TaskAttributesSetDetached (bool state)
 Sets the detached property of a Task. More...
 
TaskAttributesSetPriority (mtapi_uint_t priority)
 Sets the priority of a Task. More...
 
TaskAttributesSetAffinity (mtapi_affinity_t affinity)
 Sets the affinity of a Task. More...
 
TaskAttributesSetPolicy (ExecutionPolicy const &policy)
 Sets the ExecutionPolicy of a Task. More...
 
TaskAttributesSetInstances (mtapi_uint_t instances)
 Sets the number of instances in a Task. More...
 
mtapi_task_attributes_t const & GetInternal () const
 Returns the internal representation of this object. More...
 

Detailed Description

Contains attributes of a Task.

Constructor & Destructor Documentation

embb::mtapi::TaskAttributes::TaskAttributes ( )

Constructs a TaskAttributes object.

Concurrency
Not thread-safe

Member Function Documentation

TaskAttributes& embb::mtapi::TaskAttributes::SetDetached ( bool  state)

Sets the detached property of a Task.

If set to true, the started Task will have no handle and cannot be waited for.

Returns
Reference to this object.
Concurrency
Not thread-safe
Parameters
stateThe state to set.
TaskAttributes& embb::mtapi::TaskAttributes::SetPriority ( mtapi_uint_t  priority)

Sets the priority of a Task.

The priority influences the order in which tasks are chosen for execution.

Returns
Reference to this object.
Concurrency
Not thread-safe
Parameters
priorityThe priority to set.
TaskAttributes& embb::mtapi::TaskAttributes::SetAffinity ( mtapi_affinity_t  affinity)

Sets the affinity of a Task.

The affinity influences on which worker the Task will be executed.

Returns
Reference to this object.
Concurrency
Not thread-safe
Parameters
affinityThe affinity to set.
TaskAttributes& embb::mtapi::TaskAttributes::SetPolicy ( ExecutionPolicy const &  policy)

Sets the ExecutionPolicy of a Task.

The ExecutionPolicy determines the affinity and priority of a Task.

Returns
Reference to this object.
Concurrency
Not thread-safe
Parameters
policyThe ExecutionPolicy to set.
TaskAttributes& embb::mtapi::TaskAttributes::SetInstances ( mtapi_uint_t  instances)

Sets the number of instances in a Task.

The Task will be launched instances times. In the action function, the number of instances and the current instance can be queried from the TaskContext.

Returns
Reference to this object.
Concurrency
Not thread-safe
Parameters
instancesNumber of instances to set.
mtapi_task_attributes_t const& embb::mtapi::TaskAttributes::GetInternal ( ) const

Returns the internal representation of this object.

Allows for interoperability with the C interface.

Returns
A reference to the internal mtapi_task_attributes_t structure.
Concurrency
Thread-safe and wait-free