70 DEBUG_ENTRY(
"mcl_bool_t streamable = <%u>, mcl_store_t **store = <%p>", streamable, store)
76 #if !MCL_STREAM_ENABLED 90 (*store)->streamable = streamable;
92 MCL_DEBUG(
"High and Low priority lists has been successfully initialized.");
100 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, const char *configuration_id = <%p>, const char *routing = <%p>, mcl_time_series_t **time_series = <%p>",
101 store, version, configuration_id, routing, time_series)
127 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, const char *type = <%p>, const char *type_version = <%p>, E_MCL_EVENT_SEVERITY severity = <%d>, const char *timestamp = <%p>, mcl_event_t **event = <%p>", store, version, type, type_version, severity, timestamp, event)
162 item_meta_payload_local.
version = (
char *)version;
166 (
void **)(&store_data));
181 event_list = store_data->
data;
198 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, const char *file_path = <%p>, const char *file_name = <%p>, const char *file_type = <%p>, const char *routing = <%p>, mcl_file_t **file = <%p>", store, version, file_path, file_name, file_type, routing, file)
200 #if MCL_FILE_EXCHANGE_ENABLED 214 code =
file_initialize(version, file_path, file_name, file_type, routing, file);
224 MCL_ERROR(
"File exchange feature is not enabled.");
232 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, const char *type = <%p>, const char *routing = <%p>, mcl_custom_data_t **custom_data = <%p>", store,
233 version, type, routing, custom_data)
258 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, const char *type = <%p>, const char *routing = <%p>, stream_data_read_callback_t stream_data_read_callback = <%p>, void *user_context = <%p>, mcl_stream_data_t **stream_data = <%p>",
259 store, version, type, routing, stream_data_read_callback, user_context, stream_data)
274 code =
stream_data_initialize(version, type, routing, stream_data_read_callback, user_context, stream_data);
288 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, const char *version = <%p>, mcl_data_source_configuration_t **data_source_configuration = <%p>", store, version, data_source_configuration)
327 MCL_DEBUG(
"Store is already NULL. Nothing will be destroyed.");
336 DEBUG_ENTRY(
"store_data_t *store_data = <%p>, E_STORE_DATA_STATE state = <%d>", store_data, state)
338 MCL_DEBUG(
"Updating state : %d --> %d", store_data->
state, state);
339 store_data->
state = state;
347 DEBUG_ENTRY(
"store_data_t *store_data = <%p>", store_data)
352 return store_data->
state;
357 DEBUG_ENTRY(
"list_t *store_list = <%p>, list_node_t *store_data_node = <%p>", store_list, store_data_node)
377 DEBUG_ENTRY(
"mcl_store_t *store = <%p>, void *data = <%p>, E_STORE_DATA_TYPE data_type = <%d>, E_STORE_DATA_PRIORITY priority = <%d>", store, data, data_type, priority)
386 store_data->
data = data;
387 store_data->
type = data_type;
394 list_to_add = (
PRIORITY_HIGH == priority) ? store->high_priority_list : store->low_priority_list;
396 code =
list_add(list_to_add, store_data);
423 MCL_DEBUG(
"Item type is time_series, calling its destroy function.");
428 MCL_DEBUG(
"Item type is event, calling its destroy function.");
433 MCL_DEBUG(
"Item type is file, calling its destroy function.");
438 MCL_DEBUG(
"Item type is custom data, calling its destroy function.");
443 MCL_DEBUG(
"Item type is stream data, calling its destroy function.");
448 MCL_DEBUG(
"Item type is data source configuration, calling its destroy function.");
453 MCL_FATAL(
"Received type of store list item is unknown!");
470 DEBUG_ENTRY(
"void *data = <%p>, const item_meta_payload_local_t *item_meta_payload = <%p>", data, item_meta_payload)
481 MCL_DEBUG(
"There is an event set already created with the same type and version in the list.");
503 ok = ok && (dot_index > 0 && dot_index < version_length - 1);
517 DEBUG_ENTRY(
"const char *version = <%p>, mcl_size_t start_index = <%u>, mcl_size_t end_index = <%u>", version, start_index, end_index)
522 for (index = start_index; index < end_index; index++)
524 if (version[index] <
'0' || version[index] >
'9')
store_data_stream_info_t * stream_info
Stream information.
static mcl_int32_t _event_severity_values[EVENT_VERSION_END][MCL_EVENT_SEVERITY_END]
void string_destroy(string_t **string)
Destroys the allocated resources of the string.
Data source configuration module header file.
void data_source_configuration_destroy(data_source_configuration_t **data_source_configuration)
E_MCL_ERROR_CODE event_list_add_event(event_t *event, event_list_t *event_list)
This function adds event to event_list.
static E_MCL_ERROR_CODE _compare_item_meta_of_event(void *data, const item_meta_payload_local_t *item_meta_payload)
Memory module header file.
E_MCL_ERROR_CODE mcl_store_new_event(mcl_store_t *store, const char *version, const char *type, const char *type_version, E_MCL_EVENT_SEVERITY severity, const char *timestamp, mcl_event_t **event)
list_t * high_priority_list
Contains high priority store_data_t data.
void file_destroy(file_t **file)
struct mcl_data_source_configuration_t mcl_data_source_configuration_t
Type of the data in the store is time series.
static const string_t _event_versions[EVENT_VERSION_END]
Type of the data in the store is stream.
E_MCL_ERROR_CODE mcl_store_new_time_series(mcl_store_t *store, const char *version, const char *configuration_id, const char *routing, mcl_time_series_t **time_series)
Represents the low priority data to be sent to MindSphere.
If a particular operation is not supported.
mcl_size_t(* mcl_stream_data_read_callback_t)(void *destination, void *source, mcl_size_t size, void *user_context)
Stream data read callback function definition.
char * buffer
Buffer of string handle.
Severity level of event is ERROR.
Business event type of meta field payload.
This struct is used for building the complete message of time series event.
mcl_bool_t string_util_find(const char *source, const char *target, mcl_size_t *start_index)
Finds the first occurence of target in source and puts it's first index to start_index.
Type of the data in the store is data source configuration.
list_t * low_priority_list
Contains low priority store_data_t data.
Store module header file.
Initial state of a store data. Means this data is not processed before.
E_MCL_ERROR_CODE custom_data_initialize(const char *version, const char *type, const char *routing, custom_data_t **custom_data)
Initializes custom_data.
E_MCL_ERROR_CODE list_exist(list_t *list, const void *item_to_find, list_compare_callback compare_function, void **item)
Searches item_to_find in the list.
mcl_list_compare_callback list_compare_callback
#define ASSERT_NOT_NULL(argument)
#define MCL_FALSE
MCL bool type.
E_MCL_ERROR_CODE file_initialize(const char *version, const char *file_path, const char *file_name, const char *file_type, const char *routing, file_t **file)
E_MCL_ERROR_CODE string_compare_with_cstr(const string_t *string, const char *other)
Compare the contents of string_t with a C string.
struct mcl_event_t mcl_event_t
This struct is used for building only one message of event.
Log utility module header file.
E_MCL_ERROR_CODE list_initialize(list_t **list)
Initializes the list.
static mcl_bool_t _is_valid_version(const char *version)
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
Type of the data in the store is custom data.
struct mcl_time_series_t mcl_time_series_t
This struct is used for building the time series type.
Type of the data in the store is file.
struct mcl_custom_data_t mcl_custom_data_t
This struct is used for building the custom data type.
E_STORE_DATA_TYPE type
Type of data in the store.
void time_series_destroy(time_series_t **time_series)
To destroy the time_series_t data struct.
void store_data_set_state(store_data_t *store_data, E_STORE_DATA_STATE state)
struct mcl_store_t mcl_store_t
#define ASSERT_STATEMENT_CODE_MESSAGE(condition, statement, return_code,...)
E_MCL_ERROR_CODE event_initialize(item_meta_t *meta, const char *type, const char *version, mcl_int32_t severity, const char *timestamp, event_t **event)
This function creates and initializes a data struct of event_t.
Type of the data in the store is event list.
This struct is used for building the complete message of file.
E_MCL_ERROR_CODE mcl_store_new_data_source_configuration(mcl_store_t *store, const char *version, mcl_data_source_configuration_t **data_source_configuration)
General invalid parameter fail.
item_meta_t * meta
Meta of event list.
Stream data module header file.
mcl_uint8_t * payload_buffer
Payload of the store.
string_t * meta
Meta of the store as json string.
E_MCL_ERROR_CODE mcl_store_initialize(mcl_bool_t streamable, mcl_store_t **store)
void event_destroy(event_t **event)
To destroy the event_t data struct.
#define ASSERT_CODE_MESSAGE(condition, return_code,...)
Definitions module header file.
E_MCL_ERROR_CODE list_remove_with_content(list_t *list, list_node_t *node, list_item_destroy_callback callback)
Removes a node from the list and destroys the removed item with the provided callback function...
This struct is used for building the event.
mcl_bool_t time_util_validate_timestamp(const char *timestamp)
void stream_data_destroy(stream_data_t **stream_data)
Destroys stream_data.
E_MCL_ERROR_CODE mcl_store_new_custom_data(mcl_store_t *store, const char *version, const char *type, const char *routing, mcl_custom_data_t **custom_data)
Time series module header file.
struct mcl_stream_data_t mcl_stream_data_t
This struct is used for building the stream data type.
void event_list_destroy(event_list_t **event_list)
To destroy the event_list data struct.
This struct is used for building the custom data type.
This struct is used for building the complete message of stream data.
E_STORE_DATA_STATE store_data_get_state(store_data_t *store_data)
mcl_size_t store_get_data_count(store_t *store)
string_t meta_field_values[META_FIELD_VALUES_END]
void _store_list_destroy_callback(void **item)
Represents the high priority data to be sent to MindSphere.
static E_MCL_ERROR_CODE _store_add_data(mcl_store_t *store, void *data, E_STORE_DATA_TYPE data_type, E_STORE_DATA_PRIORITY priority)
static mcl_bool_t _is_positive_integer(const char *version, mcl_size_t start_index, mcl_size_t end_index)
Custom data module header file.
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.
Store module interface header file.
E_MCL_ERROR_CODE data_source_configuration_initialize(const char *version, data_source_configuration_t **data_source_configuration)
void * data
Data to be added to the store.
void custom_data_destroy(custom_data_t **custom_data)
Destroys custom_data.
mcl_size_t count
Node count of the list.
E_MCL_ERROR_CODE mcl_store_destroy(mcl_store_t **store)
E_MCL_ERROR_CODE mcl_store_new_file(mcl_store_t *store, const char *version, const char *file_path, const char *file_name, const char *file_type, const char *routing, mcl_file_t **file)
E_STORE_DATA_STATE state
State of data in the store.
E_MCL_ERROR_CODE list_add(list_t *list, void *data)
Adds a new list item.
Event list module header file.
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.
string_t * tuple_subboundary
Subboundary of tuple.
struct mcl_file_t mcl_file_t
This struct is used for building the complete message of file.
E_MCL_EVENT_SEVERITY
Severity values for events.
E_MCL_ERROR_CODE store_data_remove(list_t *store_list, list_node_t *store_data_node)
E_MCL_ERROR_CODE mcl_store_new_stream_data(mcl_store_t *store, const char *version, const char *type, const char *routing, mcl_stream_data_read_callback_t stream_data_read_callback, void *user_context, mcl_stream_data_t **stream_data)
E_MCL_ERROR_CODE stream_data_initialize(const char *version, const char *type, const char *routing, mcl_stream_data_read_callback_t stream_data_read_callback, void *user_context, stream_data_t **stream_data)
Initializes stream_data.
mcl_size_t string_util_strlen(const char *buffer)
Standard library strlen wrapper.
Time utility module header file.
E_MCL_ERROR_CODE event_list_initialize(const char *version, event_list_t **event_list)
This function creates and initializes a data struct of event_list.
mcl_size_t payload_size
Size of the payload in the store.
Strings with this type will NOT allocate its buffer during initialization (buffer only points of the ...