Embedded Multicore Building Blocks V1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
mtapi_queue_attributes_struct Struct Reference

Queue attributes. More...

#include <mtapi.h>

Public Types

typedef struct mtapi_queue_attributes_struct mtapi_queue_attributes_t
 Queue attributes type. More...
 

Public Member Functions

void mtapi_queueattr_init (mtapi_queue_attributes_t *attributes, mtapi_status_t *status)
 This function initializes a queue attributes object. More...
 
void mtapi_queueattr_set (mtapi_queue_attributes_t *attributes, const mtapi_uint_t attribute_num, const void *attribute, const mtapi_size_t attribute_size, mtapi_status_t *status)
 This function sets queue attribute values in a queue attributes object. More...
 

Public Attributes

mtapi_boolean_t global
 stores MTAPI_QUEUE_GLOBAL More...
 
mtapi_uint_t priority
 stores MTAPI_QUEUE_PRIORITY More...
 
mtapi_uint_t limit
 stores MTAPI_QUEUE_LIMIT More...
 
mtapi_boolean_t ordered
 stores MTAPI_QUEUE_ORDERED More...
 
mtapi_boolean_t retain
 stores MTAPI_QUEUE_RETAIN More...
 
mtapi_boolean_t domain_shared
 stores MTAPI_QUEUE_DOMAIN_SHARED More...
 

Detailed Description

Queue attributes.

Member Typedef Documentation

Queue attributes type.

Member Function Documentation

void mtapi_queueattr_init ( mtapi_queue_attributes_t attributes,
mtapi_status_t *  status 
)

This function initializes a queue attributes object.

A queue attributes object is a container of queue attributes, optionally passed to mtapi_queue_create() to create a queue with non-default attributes.

The application is responsible for allocating the mtapi_queue_attributes_t object and initializing it with a call to mtapi_queueattr_init(). The application may then call mtapi_queueattr_set() to specify queue attribute values. Calls to mtapi_queueattr_init() have no effect on queue attributes after the queue has been created. To change an attribute of an existing queue, see mtapi_queue_set_attribute(). The mtapi_queue_attributes_t object may safely be deleted by the application after the call to mtapi_queue_create().

On success, *status is set to MTAPI_SUCCESS. On error, *status is set to the appropriate error defined below.

Error code Description
MTAPI_ERR_PARAMETER Invalid attributes parameter.
MTAPI_ERR_NODE_NOTINIT The calling node is not initialized.
See also
mtapi_queue_create(), mtapi_queueattr_set(), mtapi_queue_set_attribute()
Concurrency
Not thread-safe
Parameters
[out]attributesPointer to attributes
[out]statusPointer to error code, may be MTAPI_NULL
void mtapi_queueattr_set ( mtapi_queue_attributes_t attributes,
const mtapi_uint_t  attribute_num,
const void *  attribute,
const mtapi_size_t  attribute_size,
mtapi_status_t *  status 
)

This function sets queue attribute values in a queue attributes object.

A queue attributes object is a container of queue attributes, optionally passed to mtapi_queue_create() to create a queue with non-default attributes.

attributes must be a pointer to a queue attributes object previously initialized by mtapi_queueattr_init().

See the table below for a list of predefined attribute numbers and the sizes of the attribute values. The application must set attribute_size to the exact size in bytes of the attribute value. Additional attributes may be defined by the implementation.

Calls to mtapi_queueattr_set() have no effect on queue attributes once the queue has been created. The mtapi_queue_attributes_t object may safely be deleted by the application after the call to mtapi_queue_create().

MTAPI-defined queue attributes:

Attribute num Description Data Type Default
MTAPI_QUEUE_GLOBAL Indicates if this is a globally visible queue. Only global queues are shared with other nodes. mtapi_boolean_t MTAPI_TRUE
MTAPI_QUEUE_PRIORITY Priority of the queue. mtapi_uint_t 0(default priority)
MTAPI_QUEUE_LIMIT Max. number of elements in the queue; the queue blocks on queuing more items. mtapi_uint_t 0(0 stands for 'unlimited')
MTAPI_QUEUE_ORDERED Specify if the queue is order-preserving. mtapi_boolean_t MTAPI_TRUE
MTAPI_QUEUE_RETAIN Allow enqueuing of jobs when queue is disabled. mtapi_boolean_t MTAPI_FALSE
MTAPI_DOMAIN_SHARED Indicates if the queue is shareable across domains. mtapi_boolean_t MTAPI_TRUE

On success, *status is set to MTAPI_SUCCESS. On error, *status is set to the appropriate error defined below.

Error code Description
MTAPI_ERR_ATTR_READONLY Attribute cannot be modified.
MTAPI_ERR_PARAMETER Invalid attribute parameter.
MTAPI_ERR_ATTR_NUM Unknown attribute number.
MTAPI_ERR_ATTR_SIZE Incorrect attribute size.
MTAPI_ERR_NODE_NOTINIT The calling node is not initialized.
See also
mtapi_queue_create(), mtapi_queueattr_init()
Concurrency
Not thread-safe
Parameters
[in,out]attributesPointer to attributes
[in]attribute_numAttribute id
[in]attributePointer to attribute value
[in]attribute_sizeSize of attribute value. may be 0, attribute is interpreted as value in that case
[out]statusPointer to error code, may be MTAPI_NULL

Member Data Documentation

mtapi_boolean_t mtapi_queue_attributes_struct::global

stores MTAPI_QUEUE_GLOBAL

mtapi_uint_t mtapi_queue_attributes_struct::priority

stores MTAPI_QUEUE_PRIORITY

mtapi_uint_t mtapi_queue_attributes_struct::limit

stores MTAPI_QUEUE_LIMIT

mtapi_boolean_t mtapi_queue_attributes_struct::ordered

stores MTAPI_QUEUE_ORDERED

mtapi_boolean_t mtapi_queue_attributes_struct::retain

stores MTAPI_QUEUE_RETAIN

mtapi_boolean_t mtapi_queue_attributes_struct::domain_shared

stores MTAPI_QUEUE_DOMAIN_SHARED