Data Delivery C API Library Reference
1.2
|
Data Structures | |
struct | ddca_event_t |
Event variable type for DDCA Event API. More... | |
Functions | |
int | ddca_event_create (const char *device_id, ddca_event_t **evt) |
create an ddca_event_t variable instance | |
int | ddca_event_destroy (ddca_event_t *evt) |
destroy an event variable | |
int | ddca_event_set_source (ddca_event_t *evt, const char *device_id) |
set a source data to a given ddca_event_t variable | |
int | ddca_event_get_source (const ddca_event_t *evt, char **device_id) |
get a source data from a given ddca_event_t variable | |
int | ddca_event_set_data_type (ddca_event_t *evt, const char *data_type) |
set a data_type attribute to a given ddca_event_t variable | |
int | ddca_event_get_data_type (const ddca_event_t *evt, char **data_type) |
get a data_type attribute from a given ddca_event_t variable | |
int | ddca_event_set_op_id (ddca_event_t *evt, const char *op_id) |
set a given operation id to the given event variable | |
int | ddca_event_get_op_id (const ddca_event_t *evt, char **op_id) |
get an operation id from the given event variable | |
int | ddca_event_get_op_type (const ddca_event_t *evt, char **op_type) |
get an operation type from the given event variable | |
int | ddca_event_get_sink (const ddca_event_t *evt, char **sink) |
get a target id from the given event variable | |
int | ddca_event_get_notification_type (const ddca_event_t *evt, char **notification_type) |
get a target notification type from the given event variable | |
int | ddca_event_put_string_value (ddca_event_t *evt, const char *name, const char *value) |
add a pair of key/value string attribute to the specified event variable | |
int | ddca_event_put_bool_value (ddca_event_t *evt, const char *name, const ddca_bool_t value) |
add a pair of string key and bool value attribute to the specified event variable | |
int | ddca_event_put_int_value (ddca_event_t *evt, const char *name, const ddca_int32_t value) |
add a pair of string key and int value attribute to the specified event variable | |
int | ddca_event_put_double_value (ddca_event_t *evt, const char *name, const ddca_double64_t value) |
add a pair of string key and double value attribute to the specified event variable | |
int | ddca_event_put_null (ddca_event_t *evt, const char *name) |
add a pair of string key and null value attribute to the specified event variable | |
int | ddca_event_get_string_value (const ddca_event_t *evt, const char *name, char **ret) |
get a string value of a specified attribute from given event variable | |
int | ddca_event_get_bool_value (const ddca_event_t *evt, const char *name, ddca_bool_t *ret) |
get a bool value of a specified attribute from given event variable | |
int | ddca_event_get_int_value (const ddca_event_t *evt, const char *name, ddca_int32_t *ret) |
get an int value of a specified attribute from given event variable | |
int | ddca_event_get_double_value (const ddca_event_t *evt, const char *name, ddca_double64_t *ret) |
get a double value of a specified attribute from given event variable | |
int | ddca_event_is_null_value (const ddca_event_t *evt, const char *name, int *ret) |
return whether a specified attribute in the given event variable is null or not | |
int | ddca_event_del_value (ddca_event_t *evt, const char *name) |
delete a specified ddca_event_t object from the ddca_event_t object | |
int | ddca_event_put_map (ddca_event_t *evt, const char *name, ddca_map_t *map) |
add a pair of string key and ddca_map_t variable to the specified event variable | |
int | ddca_event_get_map (const ddca_event_t *evt, const char *name, ddca_map_t **ret) |
get a ddca_map_t instance of a specified attribute from given event variable | |
int | ddca_event_put_array (ddca_event_t *evt, const char *name, ddca_array_t *array) |
add a pair of string key and ddca_array_t variable to the specified event variable | |
int | ddca_event_get_array (const ddca_event_t *evt, const char *name, ddca_array_t **ret) |
get a ddca_array_t instance of a specified attribute from given event variable | |
int | ddca_event_register_shutdown_cb (int(*SHUTDOWN_CB)(const ddca_event_t *request)) |
register the shutdown callback function | |
Variables | |
ddca_bool_t | ddca_shutdown_request_flag |
int ddca_event_create | ( | const char * | device_id, |
ddca_event_t ** | evt | ||
) |
create an ddca_event_t variable instance
This function creates an ddca_event_t variable instance.
[out] | *evt | ddca_event_t variable to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_del_value | ( | ddca_event_t * | evt, |
const char * | name | ||
) |
delete a specified ddca_event_t object from the ddca_event_t object
This function deletes a ddca_event_t object specified with the name from the ddca_event_t object . This function works only the same level as the given variable; use ddca_get_object and this function to delete the nested attribute.
[in,out] | *evt | event variable to delete from |
[in] | *name | event name to be deleted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_destroy | ( | ddca_event_t * | evt | ) |
destroy an event variable
This function destroys a given event variable and all its descendant variables put to this event variable.
[in] | *evt | ddca_event_t variable to be destroyed |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_array | ( | const ddca_event_t * | evt, |
const char * | name, | ||
ddca_array_t ** | ret | ||
) |
get a ddca_array_t instance of a specified attribute from given event variable
This function searches and returns a ddca_array_t instance of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable. Note that the output array must not be freed since this function return the reference to it.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_bool_value | ( | const ddca_event_t * | evt, |
const char * | name, | ||
ddca_bool_t * | ret | ||
) |
get a bool value of a specified attribute from given event variable
This function searches and returns a bool value of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable. Note that the bool value is represented as a ddca_bool_t type and DDCA_BOOL value.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_data_type | ( | const ddca_event_t * | evt, |
char ** | data_type | ||
) |
get a data_type attribute from a given ddca_event_t variable
This function gets a data_type attribute from a given ddca_event_t variable.
[in] | *evt | ddca_event_t variable to get from |
[out] | **data_type | data_type to be gotton |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_double_value | ( | const ddca_event_t * | evt, |
const char * | name, | ||
ddca_double64_t * | ret | ||
) |
get a double value of a specified attribute from given event variable
This function searches and returns a double value of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_int_value | ( | const ddca_event_t * | evt, |
const char * | name, | ||
ddca_int32_t * | ret | ||
) |
get an int value of a specified attribute from given event variable
This function searches and returns an int value of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_map | ( | const ddca_event_t * | evt, |
const char * | name, | ||
ddca_map_t ** | ret | ||
) |
get a ddca_map_t instance of a specified attribute from given event variable
This function searches and returns a ddca_map_t instance of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable. Note that the output map must not be freed since this function return the reference to it.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_notification_type | ( | const ddca_event_t * | evt, |
char ** | notification_type | ||
) |
get a target notification type from the given event variable
This function gets a notification type from the given event variable. Note that the input notification_type variable cannot be freed after the call.
[in] | *evt | event variable to get target id |
[out] | **notification_type | sink variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_op_id | ( | const ddca_event_t * | evt, |
char ** | op_id | ||
) |
get an operation id from the given event variable
This function gets an operation id from the given event variable. Note that the input op_id variable cannot be freed after the call.
[in] | *evt | event variable to get op_id |
[out] | **op_id | operation_id variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_op_type | ( | const ddca_event_t * | evt, |
char ** | op_type | ||
) |
get an operation type from the given event variable
This function gets an operation type from the given event variable. Note that the input op_type variable cannot be freed after the call.
[in] | *evt | event variable to get op_type |
[out] | **op_type | operation_type variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_sink | ( | const ddca_event_t * | evt, |
char ** | sink | ||
) |
get a target id from the given event variable
This function gets a target id from the given event variable. Note that the input sink variable cannot be freed after the call.
[in] | *evt | event variable to get target id |
[out] | **sink | sink variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_source | ( | const ddca_event_t * | evt, |
char ** | device_id | ||
) |
get a source data from a given ddca_event_t variable
This function gets a source data from a given ddca_event_t variable.
[in] | *evt | ddca_event_t variable to get from |
[out] | **device_id | source data to be gotton |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_get_string_value | ( | const ddca_event_t * | evt, |
const char * | name, | ||
char ** | ret | ||
) |
get a string value of a specified attribute from given event variable
This function searches and returns a string value of a specified attribute from given event variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable. Note that the output string must be freed after the use.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_is_null_value | ( | const ddca_event_t * | evt, |
const char * | name, | ||
int * | ret | ||
) |
return whether a specified attribute in the given event variable is null or not
This function searches and returns the result whether a specified attribute in the given event variable is null or not. This function do not search the nested values. So the attribute to be returned must locate the same level as the given event variable.
[in] | *evt | event variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_array | ( | ddca_event_t * | evt, |
const char * | name, | ||
ddca_array_t * | array | ||
) |
add a pair of string key and ddca_array_t variable to the specified event variable
This function adds a pair of string key and ddca_array_t variable to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure. Note that the input array must not be freed since this function use the reference to it.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | *array | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_bool_value | ( | ddca_event_t * | evt, |
const char * | name, | ||
const ddca_bool_t | value | ||
) |
add a pair of string key and bool value attribute to the specified event variable
This function adds a pair of string key and bool value attribute to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event. this function will return failure.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_double_value | ( | ddca_event_t * | evt, |
const char * | name, | ||
const ddca_double64_t | value | ||
) |
add a pair of string key and double value attribute to the specified event variable
This function adds a pair of string key and double value attribute to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_int_value | ( | ddca_event_t * | evt, |
const char * | name, | ||
const ddca_int32_t | value | ||
) |
add a pair of string key and int value attribute to the specified event variable
This function adds a pair of string key and int value attribute to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_map | ( | ddca_event_t * | evt, |
const char * | name, | ||
ddca_map_t * | map | ||
) |
add a pair of string key and ddca_map_t variable to the specified event variable
This function adds a pair of string key and ddca_map_t variable to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure. Note that the input map must not be freed since this function use the reference to it.
[in,out] | *evt | event variable to add |
[in] | *name | name of attribute to be added |
[in] | *map | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_null | ( | ddca_event_t * | evt, |
const char * | name | ||
) |
add a pair of string key and null value attribute to the specified event variable
This function adds a pair of string key and null value attribute to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_put_string_value | ( | ddca_event_t * | evt, |
const char * | name, | ||
const char * | value | ||
) |
add a pair of key/value string attribute to the specified event variable
This function adds a pair of key/value string attribute to the specified event variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target event, this function will return failure. The input string can be freed if the function is success.
[in,out] | *evt | event variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | *value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_register_shutdown_cb | ( | int(*)(const ddca_event_t *request) | SHUTDOWN_CB | ) |
register the shutdown callback function
This function registers the shutdown callback function which is called by the Data Delivery Core to notify process shutdown request.
[in] | *SHUTDOWN_CB | the pointer which indicates the shutdown callback function |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_set_data_type | ( | ddca_event_t * | evt, |
const char * | data_type | ||
) |
set a data_type attribute to a given ddca_event_t variable
This function sets a data_type attribute to a given ddca_event_t variable. If this function is called with the variable whose data_type attribute has already set, the data_type attribute of given variable will be overwrittten.
[in,out] | *evt | ddca_event_t variable to set to |
[in] | *data_type | data_type to be set |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_set_op_id | ( | ddca_event_t * | evt, |
const char * | op_id | ||
) |
set a given operation id to the given event variable
This function sets a given operation id to op_id attribute of given event variable. Note that the given op_id can be freed if the function is success.
[in,out] | evt | event variable to set to |
[in] | *op_id | operation_id to be set |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_event_set_source | ( | ddca_event_t * | evt, |
const char * | device_id | ||
) |
set a source data to a given ddca_event_t variable
This function sets a source data to a given ddca_event_t variable. If this function is called with the variable whose source data has already set, the source data of given variable will be overwrittten.
[in,out] | *evt | ddca_event_t variable to set to |
[in] | *device_id | source data to be set |
DDCA_SUCCESS | operation success |
others | operation failure |