Store module interface header file. More...
#include "mcl_connectivity/mcl_connectivity_common.h"
Go to the source code of this file.
Typedefs | |
typedef struct mcl_store_t | mcl_store_t |
Functions | |
MCL_CONNECTIVITY_EXPORT mcl_error_t | mcl_store_initialize (mcl_store_t **store) |
MCL_CONNECTIVITY_EXPORT mcl_error_t | mcl_store_add (mcl_store_t *store, void *item) |
MCL_CONNECTIVITY_EXPORT void | mcl_store_destroy (mcl_store_t **store) |
Store module interface header file.
Store is the container for all types of data such as mcl_custom_data_t, mcl_event_t, mcl_file_t, mcl_data_source_configuration_t and mcl_timeseries_t to be exchanged using MCL.
Agents can upload store to MindSphere. This module enables the agent to initialize a store data type using mcl_store_initialize function. Following initialization, all types of data can be added to the store using mcl_store_add function. Once the store data type is ready, it can be uploaded to MindSphere using mcl_connectivity_exchange function. After the exchange operation, the agent is expected to destroy the store using mcl_store_destroy function.
For more information, please look at example file "mcl_connectivity/examples/store_upload.c".
Definition in file mcl_store.h.
typedef struct mcl_store_t mcl_store_t |
Handle for store.
Definition at line 33 of file mcl_store.h.
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_store_add | ( | mcl_store_t * | store, |
void * | item | ||
) |
This function adds a new item to store.
[in] | store | MCL store which will contain any type of item created. |
[in] | item | Item to be added to store. |
Definition at line 58 of file store.c.
References _store_add_data(), MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, and MCL_ITEM_PREAMBLE.
MCL_CONNECTIVITY_EXPORT void mcl_store_destroy | ( | mcl_store_t ** | store | ) |
This function destroys the mcl_store_t object and frees any memory allocated.
[in] | store | Preinitialized mcl_store_t object to destroy. |
store
is NULL. Definition at line 81 of file store.c.
References MCL_DEBUG, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_list_destroy_with_content(), MCL_NULL, and store_item_destroy().
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_store_initialize | ( | mcl_store_t ** | store | ) |
This function creates and initializes an object of type mcl_store_t.
Store is used to hold different types of data. These data will be processed later by connectivity module. to perform exchange operation.
[out] | store | The newly initialized store. |
store
is NULL. Definition at line 30 of file store.c.
References MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_ASSERT_STATEMENT_CODE_MESSAGE, MCL_DEBUG, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, MCL_FUNCTION_LEAVE_LABEL, MCL_ITEM_PREAMBLE, MCL_ITEM_TYPE_STORE, mcl_list_initialize(), MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.