Event module implementation file. More...
#include "mcl_connectivity/mcl_event.h"
#include "event.h"
#include "mcl_core/mcl_memory.h"
#include "mcl_core/mcl_random.h"
#include "mcl_core/mcl_string_util.h"
Go to the source code of this file.
Macros | |
#define | MCL_EVENT_PARAMETER_DESCRIPTION_MAXIMUM_LENGTH 256 |
Functions | |
mcl_error_t | mcl_event_initialize (E_MCL_EVENT_VERSION version, mcl_event_t **event) |
mcl_error_t | mcl_event_set_parameter (mcl_event_t *event, E_MCL_EVENT_PARAMETER parameter, const void *value) |
mcl_error_t | event_validate (event_t *event) |
void | mcl_event_destroy (mcl_event_t **event) |
Variables | |
const char * | mcl_event_versions [MCL_EVENT_VERSION_END] = { "1.0", "2.0" } |
static mcl_int32_t | _event_severity_values [MCL_EVENT_VERSION_END][MCL_EVENT_SEVERITY_END] |
Event module implementation file.
Definition in file event.c.
#define MCL_EVENT_PARAMETER_DESCRIPTION_MAXIMUM_LENGTH 256 |
Definition at line 15 of file event.c.
Referenced by mcl_event_set_parameter().
mcl_error_t event_validate | ( | event_t * | event | ) |
This function checks whether all mandatory parameters of an event are set or not.
[in] | event | Event to validate. |
Definition at line 158 of file event.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INVALID_PARAMETER, MCL_NULL, MCL_OK, mcl_time_util_validate_timestamp(), MCL_TRUE, event_t::payload, event_payload_t::timestamp, event_payload_t::type, and event_payload_t::version.
Referenced by _store_add_data(), and connectivity_processor_exchange().
void mcl_event_destroy | ( | mcl_event_t ** | event | ) |
This function destroys event data structure.
[in] | event | Event handle which is going to be destroyed. |
Definition at line 186 of file event.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_json_util_destroy(), and MCL_NULL.
Referenced by _item_destroy(), and mcl_event_initialize().
mcl_error_t mcl_event_initialize | ( | E_MCL_EVENT_VERSION | version, |
mcl_event_t ** | event | ||
) |
This function creates and initializes a data struct of mcl_event_t.
[in] | version | One of the versions listed in E_MCL_EVENT_VERSION. |
[out] | event | Event handle which is going to be initialized. |
Definition at line 25 of file event.c.
References _event_severity_values, MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_event_destroy(), MCL_EVENT_SEVERITY_INFORMATION, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, MCL_ITEM_PREAMBLE, MCL_ITEM_TYPE_EVENT, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, and mcl_random_generate_guid().
mcl_error_t mcl_event_set_parameter | ( | mcl_event_t * | event, |
E_MCL_EVENT_PARAMETER | parameter, | ||
const void * | value | ||
) |
This function is used to set a parameter of an event.
[in] | event | Event to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_EVENT_PARAMETER. |
[in] | value | New value of the parameter . |
event
or value
is NULL. parameter
is invalid. Definition at line 80 of file event.c.
References _event_severity_values, MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_EVENT_PARAMETER_CORRELATION_ID, MCL_EVENT_PARAMETER_DESCRIPTION, MCL_EVENT_PARAMETER_DESCRIPTION_MAXIMUM_LENGTH, MCL_EVENT_PARAMETER_DETAILS, MCL_EVENT_PARAMETER_SEVERITY, MCL_EVENT_PARAMETER_TIMESTAMP_EPOCH, MCL_EVENT_PARAMETER_TIMESTAMP_ISO8601, MCL_EVENT_PARAMETER_TYPE, MCL_EVENT_PARAMETER_VERSION, MCL_EVENT_SEVERITY_END, MCL_EVENT_SEVERITY_ERROR, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, mcl_json_util_destroy(), mcl_json_util_duplicate(), MCL_OK, mcl_string_util_memcpy(), mcl_string_util_reset(), mcl_string_util_strlen(), mcl_time_util_convert_to_iso_8601_format(), mcl_time_util_validate_timestamp(), MCL_TIMESTAMP_LENGTH, and MCL_TRUE.
|
static |
Definition at line 19 of file event.c.
Referenced by mcl_event_initialize(), and mcl_event_set_parameter().
const char* mcl_event_versions[MCL_EVENT_VERSION_END] = { "1.0", "2.0" } |
Definition at line 17 of file event.c.
Referenced by _add_item_meta_payload(), and _item_meta_size().