Data source module implementation file. More...
#include "mcl_connectivity/mcl_data_source.h"
#include "data_source.h"
#include "mcl_core/mcl_memory.h"
#include "mcl_core/mcl_string_util.h"
Go to the source code of this file.
Functions | |
mcl_error_t | mcl_data_source_initialize (mcl_data_source_t **data_source) |
mcl_error_t | mcl_data_source_set_parameter (mcl_data_source_t *data_source, E_MCL_DATA_SOURCE_PARAMETER parameter, const void *value) |
mcl_error_t | mcl_data_source_add_data_point (mcl_data_source_t *data_source, mcl_data_point_t *data_point) |
mcl_error_t | data_source_validate (data_source_t *data_source) |
void | mcl_data_source_destroy (mcl_data_source_t **data_source) |
Data source module implementation file.
Definition in file data_source.c.
mcl_error_t data_source_validate | ( | data_source_t * | data_source | ) |
This function checks whether all mandatory parameters of a data source are set or not.
[in] | data_source | Data source to validate. |
Definition at line 105 of file data_source.c.
References mcl_list_t::count, mcl_list_node_t::data, data_point_validate(), data_source_t::data_points, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_ERROR_STRING, MCL_INVALID_PARAMETER, mcl_list_next(), mcl_list_reset(), MCL_NULL, MCL_OK, and data_source_t::name.
Referenced by data_source_configuration_validate().
mcl_error_t mcl_data_source_add_data_point | ( | mcl_data_source_t * | data_source, |
mcl_data_point_t * | data_point | ||
) |
This function adds data_point
to data_source
.
[in] | data_source | mcl_data_source_t object handle which data_point is added to. |
[in] | data_point | mcl_data_point_t object handle which contains data point information. |
data_source
or data_point
is null. data_source
has no space for a new data point. Definition at line 87 of file data_source.c.
References MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, and mcl_list_add().
void mcl_data_source_destroy | ( | mcl_data_source_t ** | data_source | ) |
This function destroys data_source
.
[in] | data_source | Data source handle which is going to be destroyed. |
Definition at line 147 of file data_source.c.
References mcl_data_point_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_json_util_destroy(), mcl_list_destroy_with_content(), and MCL_NULL.
Referenced by _parse_data_source(), _parse_data_source_configuration(), mcl_data_source_configuration_destroy(), and mcl_data_source_initialize().
mcl_error_t mcl_data_source_initialize | ( | mcl_data_source_t ** | data_source | ) |
This function creates and initializes a data struct of mcl_data_source_t.
[out] | data_source | Data source handle which is going to be initialized. |
data_source
is null. Definition at line 14 of file data_source.c.
References MCL_ASSERT_NOT_NULL, mcl_data_source_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, mcl_list_initialize(), MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.
Referenced by _parse_data_source().
mcl_error_t mcl_data_source_set_parameter | ( | mcl_data_source_t * | data_source, |
E_MCL_DATA_SOURCE_PARAMETER | parameter, | ||
const void * | value | ||
) |
This function is used to set a parameter of a data source.
[in] | data_source | Data source to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_DATA_SOURCE_PARAMETER. |
[in] | value | New value of the parameter . |
data_source
or value
is NULL. parameter
is invalid. Definition at line 51 of file data_source.c.
References MCL_ASSERT_NOT_NULL, MCL_DATA_SOURCE_PARAMETER_CUSTOM_DATA, MCL_DATA_SOURCE_PARAMETER_DESCRIPTION, MCL_DATA_SOURCE_PARAMETER_NAME, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, mcl_json_util_destroy(), mcl_json_util_duplicate(), and mcl_string_util_reset().