event.c File Reference

Event module implementation file. More...

Include dependency graph for event.c:

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]
 

Detailed Description

Event module implementation file.

Definition in file event.c.

Macro Definition Documentation

#define MCL_EVENT_PARAMETER_DESCRIPTION_MAXIMUM_LENGTH   256

Definition at line 15 of file event.c.

Referenced by mcl_event_set_parameter().

Function Documentation

mcl_error_t event_validate ( event_t event)

This function checks whether all mandatory parameters of an event are set or not.

Parameters
[in]eventEvent to validate.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void mcl_event_destroy ( mcl_event_t **  event)

This function destroys event data structure.

Parameters
[in]eventEvent 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]versionOne of the versions listed in E_MCL_EVENT_VERSION.
[out]eventEvent handle which is going to be initialized.
Returns

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().

Here is the call graph for this function:

mcl_error_t mcl_event_set_parameter ( mcl_event_t event,
E_MCL_EVENT_PARAMETER  parameter,
const void *  value 
)

Variable Documentation

mcl_int32_t _event_severity_values[MCL_EVENT_VERSION_END][MCL_EVENT_SEVERITY_END]
static
Initial value:
=
{
{ 1, 2, 3 },
{ 20, 30, 40 }
}

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().