28 DEBUG_ENTRY(
"const char *version = <%s>, const char *configuration_id = <%s>, const char *routing = <%p>, time_series_t **time_series = <%p>", version, configuration_id,
35 (*time_series)->meta.content_id =
MCL_NULL;
36 (*time_series)->meta.type =
MCL_NULL;
37 (*time_series)->meta.version =
MCL_NULL;
38 (*time_series)->meta.details.routing =
MCL_NULL;
39 (*time_series)->meta.payload.type =
MCL_NULL;
40 (*time_series)->meta.payload.version =
MCL_NULL;
41 (*time_series)->meta.payload.details.time_series_details.configuration_id =
MCL_NULL;
42 (*time_series)->payload.value_sets =
MCL_NULL;
57 DEBUG_ENTRY(
"mcl_time_series_t *time_series = <%p>, const char *timestamp = <%p>, mcl_time_series_value_set_t **value_set = <%p>", time_series, timestamp, value_set)
79 (*value_set)->parent = time_series;
82 MCL_DEBUG(
"New value_set will be added to value_sets.");
83 code =
list_add(time_series->payload.value_sets, *value_set);
92 DEBUG_ENTRY(
"mcl_time_series_value_set_t *value_set = <%p>, const char *data_point_id = <%p>, const char *value = <%p>, const char *quality_code = <%p>", value_set,
93 data_point_id, value, quality_code)
115 code =
list_add(value_set->values, value_local);
118 MCL_DEBUG(
"New value added into values array. Current index = <%d>", value_set->values->count);
125 DEBUG_ENTRY(
"time_series_t **time_series = <%p>", time_series)
135 string_destroy(&((*time_series)->meta.payload.details.time_series_details.configuration_id));
146 DEBUG_ENTRY(
"const char *version = <%s>, const char *configuration_id = <%s>, const char *routing = <%p>, time_series_t *time_series = <%p>", version, configuration_id,
147 routing, time_series)
185 DEBUG_ENTRY(
"time_series_value_t **value = <%p>", value)
197 DEBUG_ENTRY(
"time_series_value_set_t **value_set = <%p>", value_set)
void string_destroy(string_t **string)
Destroys the allocated resources of the string.
string_t * data_point_id
Id of the datapoint the value is read from.
Memory module header file.
Time series type of meta field payload.
static void _destroy_value_set(time_series_value_set_t **value_set)
E_MCL_ERROR_CODE string_initialize_new(const char *value, mcl_size_t value_length, string_t **string)
Initializes a new string_t object with the given value and length.
This struct is used for building the complete message of time series event.
#define ASSERT_NOT_NULL(argument)
Log utility module header file.
E_MCL_ERROR_CODE list_initialize(list_t **list)
Initializes the list.
Current version of meta field.
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
E_MCL_ERROR_CODE mcl_time_series_add_value(mcl_time_series_value_set_t *value_set, const char *data_point_id, const char *value, const char *quality_code)
This function adds data_point_id, value and quality_code to mcl_time_series_value_set_t.
This struct is used for building value set of time series.
struct mcl_time_series_t mcl_time_series_t
This struct is used for building the time series type.
void time_series_destroy(time_series_t **time_series)
To destroy the time_series_t data struct.
#define ASSERT_STATEMENT_CODE_MESSAGE(condition, statement, return_code,...)
E_MCL_ERROR_CODE mcl_time_series_new_value_set(mcl_time_series_t *time_series, const char *timestamp, mcl_time_series_value_set_t **value_set)
This function creates new value set to be added to mcl_time_series_t.
General invalid parameter fail.
#define ASSERT_CODE_MESSAGE(condition, return_code,...)
Definitions module header file.
Time series module interface header file.
mcl_bool_t time_util_validate_timestamp(const char *timestamp)
Time series module header file.
string_t meta_field_values[META_FIELD_VALUES_END]
string_t * quality_code
The quality of the value provided.
void list_destroy_with_content(list_t **list, list_item_destroy_callback callback)
To destroy the list and its items with a given callback function.
This struct is used for building time_series.payload.values structure.
E_MCL_ERROR_CODE string_initialize_static(const char *value, mcl_size_t value_length, string_t **string)
Initializes a static string_t object with the given value and length.
static E_MCL_ERROR_CODE _initialize_meta(const char *version, const char *configuration_id, const char *routing, time_series_t *time_series)
item_meta_t meta
Meta of time series.
string_t * value
The value read.
E_MCL_ERROR_CODE list_add(list_t *list, void *data)
Adds a new list item.
E_MCL_ERROR_CODE time_series_initialize(const char *version, const char *configuration_id, const char *routing, time_series_t **time_series)
This function creates and initializes a data struct of time_series_t.
mcl_list_item_destroy_callback list_item_destroy_callback
static void _destroy_value_set_value(time_series_value_t **value)
Time utility module header file.
struct mcl_time_series_value_set_t mcl_time_series_value_set_t
This struct is used for building value set of time series.