event_source.h

// SPDX-License-Identifier: MIT

safuResultE_t elosEventSourceDeepCopy(elosEventSource_t *to, const elosEventSource_t *from)
[source]

Duplicates elosEventSource_t with its members

Info:

The returned object must be destroyed with elosEventSourceDelete().

Parameters:
Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.

void elosEventSourceDelete(elosEventSource_t *eventSource)
[source]

Frees an event allocated with elosEventSourceNew() or losEventSourceDeepCopy().

Parameters:
void elosEventSourceDeleteMembers(elosEventSource_t *eventSource)
[source]

Frees all members of an event.

Parameters:
  • eventSource (elosEvnetSource_t*) – Pointer to the eventSource.

safuResultE_t elosEventSourceDeserialize(elosEventSource_t *to, const char *fromJsonString)
[source]

Stores the information of a JSON formatted string into a elosEventSource_t object.

Parameters:
  • to (elosEventSource_t*) – Event to safe the data from the JSON to.

  • fromJsonString (const char*) – JSON formatted string to deserialize.

Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.

safuResultE_t elosEventSourceFromJsonObject(elosEventSource_t *to, const json_object *from)
[source]

Converts the information from a JSON object and stores them into an existing event.

Parameters:
  • to (elosEventSource_t*) – The evnt to convert into.

  • from (const json_object*) – The JSON obect to convert.

Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.

safuResultE_t elosEventSourceNew(elosEventSource_t **eventSource)
[source]

Allocates a new event.

Info:

The returned object must be destroyed with elosEventSourceDelete().

Parameters:
Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.

safuResultE_t elosEventSourceSerialize(char **toJsonString, elosEventSource_t *from)
[source]

Saves the members of an elosEventSource_t into a JSON formatted string.

Parameters:
  • toJsonString (char**) – the string to safe the event to.

  • from (elosEventSouce_t*) – the event to serialize.

Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.

safuResultE_t elosEventSourceToJsonObject(json_object *to, const elosEventSource_t *from)
[source]

Converts the information from an event and stores them into an existing JSON object`.

Parameters:
  • to (json_object*) – The JSON object to convert to.

  • from (elosEventSource_t*) – The event to convert.

Returns:

  • SAFU_RESULT_OK on success,

  • SAFU_RESULT_FAILED on failure.