Diffusion C API 6.13.0
Loading...
Searching...
No Matches
time-series.h File Reference

Data Structures

struct  diffusion_time_series_append_params_s
 Structure supplied when issuing a diffusion_time_series_append request. More...
struct  diffusion_time_series_timestamp_append_params_s
 Structure supplied when issuing a diffusion_time_series_timestamp_append request. More...
struct  diffusion_time_series_edit_params_s
 Structure supplied when issuing a diffusion_time_series_edit request. More...

Typedefs

typedef struct DIFFUSION_TIME_SERIES_EVENT_METADATA_T DIFFUSION_TIME_SERIES_EVENT_METADATA_T
 Opaque diffusion time series event metadata struct.
typedef struct DIFFUSION_TIME_SERIES_EVENT_T DIFFUSION_TIME_SERIES_EVENT_T
 Opaque diffusion time series event struct.
typedef int(* on_append_cb) (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata, void *context)
 Callback when a time series append operation is successful.
typedef int(* on_edit_cb) (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata, void *context)
 Callback when a time series edit operation is successful.
typedef struct diffusion_time_series_append_params_s DIFFUSION_TIME_SERIES_APPEND_PARAMS_T
 Structure supplied when issuing a diffusion_time_series_append request.
typedef struct diffusion_time_series_timestamp_append_params_s DIFFUSION_TIME_SERIES_TIMESTAMP_APPEND_PARAMS_T
 Structure supplied when issuing a diffusion_time_series_timestamp_append request.
typedef struct diffusion_time_series_edit_params_s DIFFUSION_TIME_SERIES_EDIT_PARAMS_T
 Structure supplied when issuing a diffusion_time_series_edit request.

Functions

long diffusion_time_series_event_metadata_get_sequence (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata)
 Return the sequence number identifying this event within its time series.
long diffusion_time_series_event_metadata_get_timestamp (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata)
 Return the event timestamp.
char * diffusion_time_series_event_metadata_get_author (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata)
 Returns a memory allocated string of the server-authenticated identity of the session that created the event.
DIFFUSION_TIME_SERIES_EVENT_METADATA_T * diffusion_time_series_event_metadata_dup (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata)
 Returns a memory allocated copy of a DIFFUSION_TIME_SERIES_EVENT_METADATA_T
void diffusion_time_series_event_metadata_free (DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata)
 Free a memory allocated DIFFUSION_TIME_SERIES_EVENT_METADATA_T
long diffusion_time_series_event_get_sequence (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Return the sequence number identifying this event within its time series.
long diffusion_time_series_event_get_timestamp (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Return the event timestamp.
char * diffusion_time_series_event_get_author (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Returns a memory allocated string of the server-authenticated identity of the session that created the event.
DIFFUSION_VALUE_T * diffusion_time_series_event_get_value (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Returns a memory allocated DIFFUSION_VALUE_T, the time series event's value.
DIFFUSION_TIME_SERIES_EVENT_METADATA_T * diffusion_time_series_event_get_original_event (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 If this is an edit event, returns the metadata of the original event that this event replaces; otherwise returns this event.
int diffusion_time_series_event_is_edit_event (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Return whether this is an edit event.
DIFFUSION_TIME_SERIES_EVENT_T * diffusion_time_series_event_with_value (const DIFFUSION_TIME_SERIES_EVENT_T *event, const BUF_T *value)
 Clone this event with a different value.
bool read_diffusion_time_series_event (const DIFFUSION_VALUE_T *value, DIFFUSION_TIME_SERIES_EVENT_T **event, DIFFUSION_API_ERROR *error)
 Get the DIFFUSION_TIME_SERIES_EVENT_T update value.
DIFFUSION_TIME_SERIES_EVENT_T * diffusion_time_series_event_dup (const DIFFUSION_TIME_SERIES_EVENT_T *event)
 Returns a memory allocated copy of a DIFFUSION_TIME_SERIES_EVENT_T.
void diffusion_time_series_event_free (DIFFUSION_TIME_SERIES_EVENT_T *event)
 Free a memory allocated DIFFUSION_TIME_SERIES_EVENT_T
bool diffusion_time_series_append (SESSION_T *session, const DIFFUSION_TIME_SERIES_APPEND_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Update a time series topic by appending a new value.
bool diffusion_time_series_timestamp_append (SESSION_T *session, const DIFFUSION_TIME_SERIES_TIMESTAMP_APPEND_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Update a time series topic by appending a new value with a supplied timestamp.
bool diffusion_time_series_edit (SESSION_T *session, const DIFFUSION_TIME_SERIES_EDIT_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Update a time series topic by appending a new value that overrides the value of an existing event.
DIFFUSION_TIME_SERIES_RANGE_QUERY_T * diffusion_time_series_range_query (void)
 Return a default range query that performs a value range query of an entire time series.
void diffusion_time_series_range_query_free (DIFFUSION_TIME_SERIES_RANGE_QUERY_T *range_query)
 Free a memory allocated DIFFUSION_TIME_SERIES_RANGE_QUERY_T

Typedef Documentation

◆ on_append_cb

typedef int(* on_append_cb) (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata, void *context)

Callback when a time series append operation is successful.

Parameters
event_metadataThe event metadata.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

◆ on_edit_cb

typedef int(* on_edit_cb) (const DIFFUSION_TIME_SERIES_EVENT_METADATA_T *event_metadata, void *context)

Callback when a time series edit operation is successful.

Parameters
event_metadataThe event metadata.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.