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

Allows for stream processing, either ordered or unordered. More...

#include <queue.h>

Public Member Functions

 Queue ()
 Constructs an invalid Queue. More...
 
 Queue (Queue const &other)
 Copies a Queue. More...
 
Queueoperator= (Queue const &other)
 Copies a Queue. More...
 
void Delete ()
 Deletes a Queue object. More...
 
void Enable ()
 Enables the Queue. More...
 
void Disable (mtapi_timeout_t timeout)
 Disables the Queue. More...
 
void Disable ()
 Disables the Queue. More...
 
template<typename ARGS , typename RES >
Task Enqueue (mtapi_task_id_t task_id, const ARGS *arguments, RES *results, TaskAttributes const &attributes, Group const &group)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (mtapi_task_id_t task_id, const ARGS *arguments, RES *results, Group const &group)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (mtapi_task_id_t task_id, const ARGS *arguments, RES *results, TaskAttributes const &attributes)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (mtapi_task_id_t task_id, const ARGS *arguments, RES *results)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (const ARGS *arguments, RES *results, TaskAttributes const &attributes, Group const &group)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (const ARGS *arguments, RES *results, Group const &group)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (const ARGS *arguments, RES *results, TaskAttributes const &attributes)
 Enqueues a new Task. More...
 
template<typename ARGS , typename RES >
Task Enqueue (const ARGS *arguments, RES *results)
 Enqueues a new Task. More...
 
mtapi_queue_hndl_t GetInternal () const
 Returns the internal representation of this object. More...
 

Detailed Description

Allows for stream processing, either ordered or unordered.

Constructor & Destructor Documentation

embb::mtapi::Queue::Queue ( )

Constructs an invalid Queue.

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

Copies a Queue.

Concurrency
Thread-safe and wait-free
Parameters
otherThe Queue to copy

Member Function Documentation

Queue& embb::mtapi::Queue::operator= ( Queue const &  other)

Copies a Queue.

Returns
Reference to this object.
Concurrency
Thread-safe and wait-free
Parameters
otherThe Queue to copy
void embb::mtapi::Queue::Delete ( )

Deletes a Queue object.

Concurrency
Thread-safe
void embb::mtapi::Queue::Enable ( )

Enables the Queue.

Tasks enqueued while the Queue was disabled are executed.

Concurrency
Thread-safe and wait-free
void embb::mtapi::Queue::Disable ( mtapi_timeout_t  timeout)

Disables the Queue.

Running Tasks are canceled. The Queue waits for the Tasks to finish for timout milliseconds.

Concurrency
Thread-safe and wait-free
Parameters
timeoutThe timeout in milliseconds.
void embb::mtapi::Queue::Disable ( )

Disables the Queue.

Running Tasks are canceled. The Queue waits for the Tasks to finish.

Concurrency
Thread-safe and wait-free
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( mtapi_task_id_t  task_id,
const ARGS *  arguments,
RES *  results,
TaskAttributes const &  attributes,
Group const &  group 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
task_idA user defined ID of the Task.
argumentsPointer to the arguments.
resultsPointer to the results.
attributesAttributes of the Task
groupThe Group to start the Task in
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( mtapi_task_id_t  task_id,
const ARGS *  arguments,
RES *  results,
Group const &  group 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
task_idA user defined ID of the Task.
argumentsPointer to the arguments.
resultsPointer to the results.
groupThe Group to start the Task in
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( mtapi_task_id_t  task_id,
const ARGS *  arguments,
RES *  results,
TaskAttributes const &  attributes 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
task_idA user defined ID of the Task.
argumentsPointer to the arguments.
resultsPointer to the results.
attributesAttributes of the Task
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( mtapi_task_id_t  task_id,
const ARGS *  arguments,
RES *  results 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
task_idA user defined ID of the Task.
argumentsPointer to the arguments.
resultsPointer to the results.
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( const ARGS *  arguments,
RES *  results,
TaskAttributes const &  attributes,
Group const &  group 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
argumentsPointer to the arguments.
resultsPointer to the results.
attributesAttributes of the Task
groupThe Group to start the Task in
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( const ARGS *  arguments,
RES *  results,
Group const &  group 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
argumentsPointer to the arguments.
resultsPointer to the results.
groupThe Group to start the Task in
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( const ARGS *  arguments,
RES *  results,
TaskAttributes const &  attributes 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
argumentsPointer to the arguments.
resultsPointer to the results.
attributesAttributes of the Task
template<typename ARGS , typename RES >
Task embb::mtapi::Queue::Enqueue ( const ARGS *  arguments,
RES *  results 
)

Enqueues a new Task.

Returns
The handle to the enqueued Task.
Concurrency
Thread-safe
Parameters
argumentsPointer to the arguments.
resultsPointer to the results.
mtapi_queue_hndl_t embb::mtapi::Queue::GetInternal ( ) const

Returns the internal representation of this object.

Allows for interoperability with the C interface.

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