Data Delivery C API Library Reference  1.2
Data Structures | Functions | Variables
ddca_event.h File Reference

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

Detailed Description


Function Documentation

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.

Parameters:
[out]*evtddca_event_t variable to be created
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable to delete from
[in]*nameevent name to be deleted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure

destroy an event variable

This function destroys a given event variable and all its descendant variables put to this event variable.

Parameters:
[in]*evtddca_event_t variable to be destroyed
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtddca_event_t variable to get from
[out]**data_typedata_type to be gotton
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to get target id
[out]**notification_typesink variable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to get op_id
[out]**op_idoperation_id variable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to get op_type
[out]**op_typeoperation_type variable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to get target id
[out]**sinksink variable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtddca_event_t variable to get from
[out]**device_idsource data to be gotton
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*evtevent variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
[in]*arrayvalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable to add
[in]*namename of attribute to be added
[in]*mapvalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtevent variable where the attribute will be added
[in]*namename of attribute to be added
[in]*valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in]*SHUTDOWN_CBthe pointer which indicates the shutdown callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtddca_event_t variable to set to
[in]*data_typedata_type to be set
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]evtevent variable to set to
[in]*op_idoperation_id to be set
Return values:
DDCA_SUCCESSoperation success
othersoperation 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.

Parameters:
[in,out]*evtddca_event_t variable to set to
[in]*device_idsource data to be set
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
 All Data Structures Files Functions Variables Typedefs Defines