data_source.c File Reference

Data source module implementation file. More...

Include dependency graph for data_source.c:

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)
 

Detailed Description

Data source module implementation file.

Definition in file data_source.c.

Function Documentation

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.

Parameters
[in]data_sourceData source to validate.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]data_sourcemcl_data_source_t object handle which data_point is added to.
[in]data_pointmcl_data_point_t object handle which contains data point information.
Returns

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().

Here is the call graph for this function:

void mcl_data_source_destroy ( mcl_data_source_t **  data_source)

This function destroys data_source.

Parameters
[in]data_sourceData 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[out]data_sourceData source handle which is going to be initialized.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]data_sourceData source to set its parameter.
[in]parameterOne of the parameters listed in E_MCL_DATA_SOURCE_PARAMETER.
[in]valueNew value of the parameter.
Returns

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().

Here is the call graph for this function: