Data source configuration module interface header file. More...
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) |
Data source configuration module interface header file.
Definition in file mcl_data_source_configuration.h.
typedef struct mcl_data_source_configuration_t mcl_data_source_configuration_t |
This struct is used for building the data source configuration type.
Definition at line 30 of file mcl_data_source_configuration.h.
typedef struct mcl_data_source_t mcl_data_source_t |
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.
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
.
[in] | data_source | Data source the data_source_configuration encloses. |
[in] | id | Agent-unique identifier of the data point. |
[in] | name | Name of the data point. |
[in] | description | Description of the data point. This parameter is optional and can be NULL. |
[in] | type | Data type of the data point. |
[in] | unit | Measurement unit of the data point. |
[in] | custom_data | Custom 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. |
data_source
, id
, name
, type
or unit
is NULL. data_source
has no space for a new data point. 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.
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.
[in] | data_source_configuration | Data source configuration object handle. |
[in] | name | Name of the data_source . |
[in] | description | Description of the data_source . This parameter is optional and can be NULL. |
[in] | custom_data | Custom 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_source | Data source the data_source_configuration encloses. |
data_source_configuration
, name
or data_source
is NULL. data_source
. 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().
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.
[in] | data_source_configuration | Data source configuration object handle. |
[out] | id | Unique identifier of the configuration. |
data_model
or configuration_id
is NULL. 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().