Embedded Multicore Building Blocks V1.0.0
|
Action attributes. More...
#include <mtapi.h>
Public Types | |
typedef struct mtapi_action_attributes_struct | mtapi_action_attributes_t |
Action attributes type. More... | |
Public Member Functions | |
void | mtapi_actionattr_init (mtapi_action_attributes_t *attributes, mtapi_status_t *status) |
This function initializes an action attributes object. More... | |
void | mtapi_actionattr_set (mtapi_action_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 action attribute values in an action attributes object. More... | |
Public Attributes | |
mtapi_boolean_t | global |
stores MTAPI_ACTION_GLOBAL More... | |
mtapi_affinity_t | affinity |
stores MTAPI_ACTION_AFFINITY More... | |
mtapi_boolean_t | domain_shared |
stores MTAPI_ACTION_DOMAIN_SHARED More... | |
Action attributes.
typedef struct mtapi_action_attributes_struct mtapi_action_attributes_t |
Action attributes type.
void mtapi_actionattr_init | ( | mtapi_action_attributes_t * | attributes, |
mtapi_status_t * | status | ||
) |
This function initializes an action attributes object.
A action attributes object is a container of action attributes, optionally passed to mtapi_action_create() to create an action with non-default attributes.
The application is responsible for allocating the mtapi_action_attributes_t
object and initializing it with a call to mtapi_actionattr_init(). The application may then call mtapi_actionattr_set() to specify action attribute values. Calls to mtapi_actionattr_init() have no effect on action attributes after the action has been created with mtapi_action_create(). The mtapi_action_attributes_t
object may safely be deleted by the application after the call to mtapi_action_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. |
[out] | attributes | Pointer to attributes |
[out] | status | Pointer to error code, may be MTAPI_NULL |
void mtapi_actionattr_set | ( | mtapi_action_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 action attribute values in an action attributes object.
An action attributes object is a container of action attributes, optionally passed to mtapi_action_create() to create an action with non-default attributes.
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_actionattr_set() have no effect on action attributes after the action has been created. The mtapi_action_attributes_t
object may safely be deleted by the application after the call to mtapi_action_create().
MTAPI-defined action attributes:
Attribute num | Description | Data Type | Default |
---|---|---|---|
MTAPI_ACTION_GLOBAL | Indicates whether or not this is a globally visible action. Local actions are not shared with other nodes. | mtapi_boolean_t | MTAPI_TRUE |
MTAPI_ACTION_AFFINITY | Core affinity of action code. | mtapi_affinity_t | all cores set |
MTAPI_DOMAIN_SHARED | Indicates whether or not the action 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. |
[in,out] | attributes | Pointer to attributes |
[in] | attribute_num | Attribute id |
[in] | attribute | Pointer to attribute value |
[in] | attribute_size | Size of attribute value. may be 0, attribute is interpreted as value in that case |
[out] | status | Pointer to error code, may be MTAPI_NULL |
mtapi_boolean_t mtapi_action_attributes_struct::global |
stores MTAPI_ACTION_GLOBAL
mtapi_affinity_t mtapi_action_attributes_struct::affinity |
stores MTAPI_ACTION_AFFINITY
mtapi_boolean_t mtapi_action_attributes_struct::domain_shared |
stores MTAPI_ACTION_DOMAIN_SHARED