mcl_data_source_configuration.h File Reference

Data source configuration module interface header file. More...

#include "mcl/mcl_common.h"
#include "mcl/mcl_random.h"
Include dependency graph for mcl_data_source_configuration.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct mcl_data_source_configuration_t mcl_data_source_configuration_t
 
typedef struct mcl_data_source_t mcl_data_source_t
 
typedef struct mcl_json_t mcl_json_t
 

Functions

MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_add_data_source (mcl_data_source_configuration_t *data_source_configuration, const char *name, const char *description, mcl_json_t *custom_data, mcl_data_source_t **data_source)
 
MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_add_data_point (mcl_data_source_t *data_source, const char *id, const char *name, const char *description, const char *type, const char *unit, mcl_json_t *custom_data)
 
MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_get_id (mcl_data_source_configuration_t *data_source_configuration, char **id)
 

Detailed Description

Data source configuration module interface header file.


Date
Nov 13, 2017 Meta and payload parts of data source configuration type are initialized and set by this module.

Definition in file mcl_data_source_configuration.h.

Typedef Documentation

This struct is used for building the data source configuration type.

Definition at line 30 of file mcl_data_source_configuration.h.

This struct is used for building the data source type.

Definition at line 35 of file mcl_data_source_configuration.h.

typedef struct mcl_json_t mcl_json_t

This struct is used for json handling.

Definition at line 40 of file mcl_data_source_configuration.h.

Function Documentation

MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_add_data_point ( mcl_data_source_t data_source,
const char *  id,
const char *  name,
const char *  description,
const char *  type,
const char *  unit,
mcl_json_t custom_data 
)

Sets the list of data points held by the data_source.

Parameters
[in]data_sourceData source the data_source_configuration encloses.
[in]idAgent-unique identifier of the data point.
[in]nameName of the data point.
[in]descriptionDescription of the data point. This parameter is optional and can be NULL.
[in]typeData type of the data point.
[in]unitMeasurement unit of the data point.
[in]custom_dataCustom data of the data point. New memory space will be allocated for this parameter. Ownership passed to caller. Caller must free the space. This parameter is optional and can be NULL.
Returns

Definition at line 113 of file data_source_configuration.c.

References _destroy_data_point(), ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, data_point_t::custom_data, DEBUG_ENTRY, DEBUG_LEAVE, data_point_t::description, data_point_t::id, json_util_duplicate(), list_add(), MCL_DEBUG, MCL_FALSE, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_TRUE, data_point_t::name, string_initialize_new(), data_point_t::type, and data_point_t::unit.

Here is the call graph for this function:

MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_add_data_source ( mcl_data_source_configuration_t data_source_configuration,
const char *  name,
const char *  description,
mcl_json_t custom_data,
mcl_data_source_t **  data_source 
)

Sets the list of data sources the data_source_configuration encloses.

Parameters
[in]data_source_configurationData source configuration object handle.
[in]nameName of the data_source.
[in]descriptionDescription of the data_source. This parameter is optional and can be NULL.
[in]custom_dataCustom data of the data_source. New memory space will be allocated for this parameter. Ownership passed to caller. Caller must free the space. This parameter is optional and can be NULL.
[out]data_sourceData source the data_source_configuration encloses.
Returns

Definition at line 60 of file data_source_configuration.c.

References _destroy_data_source(), ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, DEBUG_ENTRY, DEBUG_LEAVE, json_util_duplicate(), list_add(), list_initialize(), MCL_DEBUG, MCL_FALSE, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_TRUE, and string_initialize_new().

Here is the call graph for this function:

MCL_EXPORT E_MCL_ERROR_CODE mcl_data_source_configuration_get_id ( mcl_data_source_configuration_t data_source_configuration,
char **  id 
)

Returns id of data_source_configuration.

Memory allocation of id is done by the function. But the responsibility of freeing id is on the user.

Parameters
[in]data_source_configurationData source configuration object handle.
[out]idUnique identifier of the configuration.
Returns

Definition at line 177 of file data_source_configuration.c.

References ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, MCL_FREE, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, and string_initialize().

Here is the call graph for this function: