Diffusion C API 6.13.0
Loading...
Searching...
No Matches
topic-notifications.h File Reference

Data Structures

struct  diffusion_topic_notification_listener_s
 Structure for adding a topic notification listener. More...

Typedefs

typedef int(* on_listener_registered_cb) (const DIFFUSION_REGISTRATION_T *registration, void *context)
 Callback when the listener has successfully been registered.
typedef int(* on_descendant_notification_cb) (const char *topic_path, const DIFFUSION_TOPIC_NOTIFICATION_TYPE_T type, void *context)
 Notification for an immediate descendant of a selected topic path.
typedef int(* on_topic_notification_cb) (const char *topic_path, const TOPIC_SPECIFICATION_T *specification, const DIFFUSION_TOPIC_NOTIFICATION_TYPE_T type, void *context)
 A notification for a selected topic.
typedef void(* on_topic_notification_listener_close_cb) (void)
 Callback for when a topic notification listener has been closed.
typedef struct diffusion_topic_notification_listener_s DIFFUSION_TOPIC_NOTIFICATION_LISTENER_T
 Structure for adding a topic notification listener.

Enumerations

enum  DIFFUSION_TOPIC_NOTIFICATION_TYPE_T { TOPIC_ADDED , TOPIC_SELECTED , TOPIC_REMOVED , TOPIC_DESELECTED }

Functions

bool diffusion_topic_notification_add_listener (SESSION_T *session, const DIFFUSION_TOPIC_NOTIFICATION_LISTENER_T listener, DIFFUSION_API_ERROR *api_error)
 Register a listener to receive topic notifications.

Typedef Documentation

◆ on_descendant_notification_cb

typedef int(* on_descendant_notification_cb) (const char *topic_path, const DIFFUSION_TOPIC_NOTIFICATION_TYPE_T type, void *context)

Notification for an immediate descendant of a selected topic path.

This notifies the presence or absence of a descendant topic that may subsequently be explicitly selected.

Parameters
topic_pathThe path of the immediate descendant that is not selected.
typeThe type of notification.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

◆ on_listener_registered_cb

typedef int(* on_listener_registered_cb) (const DIFFUSION_REGISTRATION_T *registration, void *context)

Callback when the listener has successfully been registered.

Parameters
registrationThe registration for topic notifications.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

◆ on_topic_notification_cb

typedef int(* on_topic_notification_cb) (const char *topic_path, const TOPIC_SPECIFICATION_T *specification, const DIFFUSION_TOPIC_NOTIFICATION_TYPE_T type, void *context)

A notification for a selected topic.

Parameters
topic_pathThe path of the topic that this notification is for.
specificationThe specification of the topic that this notification is for
typeThe type of notification.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

Enumeration Type Documentation

◆ DIFFUSION_TOPIC_NOTIFICATION_TYPE_T

Enumerator
TOPIC_ADDED 

The topic has been added.

TOPIC_SELECTED 

The topic existed at the time of the selector registration.

TOPIC_REMOVED 

The topic has been removed.

TOPIC_DESELECTED 

The topic is no longer selected due to the removal of a selector.