DataSource for C SDK
8.0.3.290770-7760911e
|
Data Structures | |
struct | ds5_subscriptionlistener_t |
An implementation of this interface allows applications to receive events raised for a ds5_subscription_t. More... | |
Macros | |
#define | OBJ_STATUS_INFO 0x0000 |
Status information message only. More... | |
#define | OBJ_STATUS_LIMITED 0x0008 |
The status of an object is limited. More... | |
#define | OBJ_STATUS_OK 0x0001 |
The status of an object is OK. More... | |
#define | OBJ_STATUS_STALE 0x0002 |
The status of an object is Stale. More... | |
Typedefs | |
typedef struct _ds5_subscription_s | ds5_subscription_t |
Represents a subscription to a DataSource subject (see ds_create_active_subscription()) or to a namespace of DataSource subjects (See ds_create_broadcast_subscription()). More... | |
Functions | |
ds5_subscription_t * | ds5_create_active_subscription (const char *subject, ds5_subscriptionlistener_t *listener, void *context) |
Create a subscription that matches a single subject. More... | |
ds5_subscription_t * | ds5_create_broadcast_subscription (ds5_namespace_t *nspace, ds5_subscriptionlistener_t *listener, void *context) |
Create a subscription that matches multiple subjects. More... | |
void | ds5_unsubscribe (ds5_subscription_t *sub) |
Unsubscribe from the DataSource subject or namespace of DataSource subjects. More... | |
DataSource applications can subscribe and receive updates to data from remote DataSources using the ds5_create_active_subscription() or ds5_create_broadcast_subscription() and your implementation of the ds5_subscriptionlistener_t interface.
Example: Sample code demonstrating subscribing to a single subject and implementing ds5_subscriptionlistener_t::record_updated().
#define OBJ_STATUS_INFO 0x0000 |
Status information message only.
This is a status used by the DataSource library for the ds5_subscriptionlistener_t::subscription_status() callback. An application that requests and receives data will receive this status.
#define OBJ_STATUS_LIMITED 0x0008 |
The status of an object is limited.
One or more of the non-required source for this object are down or have sent an explicit stale status message.
This is a status used by the DataSource library for the ds5_subscriptionlistener_t::subscription_status() callback. An application that requests and receives data will receive this status.
#define OBJ_STATUS_OK 0x0001 |
The status of an object is OK.
This is a status used by the DataSource library for the ds5_subscriptionlistener_t::subscription_status() callback. An application that requests and receives data will receive this status.
#define OBJ_STATUS_STALE 0x0002 |
The status of an object is Stale.
One or more of the required sources for this object are down or have sent an explicit stale status messsage. This is a status used by the DataSource library for the ds5_subscriptionlistener_t::subscription_status() callback. An application that requests and receives data will receive this status.
typedef struct _ds5_subscription_s ds5_subscription_t |
Represents a subscription to a DataSource subject (see ds_create_active_subscription()) or to a namespace of DataSource subjects (See ds_create_broadcast_subscription()).
ds5_subscription_t* ds5_create_active_subscription | ( | const char * | subject, |
ds5_subscriptionlistener_t * | listener, | ||
void * | context | ||
) |
Create a subscription that matches a single subject.
subject | - The subject that this subscription will receive updates for. |
listener | - The subscription listener that will receive updates to subjects with the supplied ds5_namespace_t. |
context | - A context that is passed to the callback functions of the subscription listener (ds5_subscriptionlistener_t). The structure and contents of this context is application specific. |
ds5_subscription_t* ds5_create_broadcast_subscription | ( | ds5_namespace_t * | nspace, |
ds5_subscriptionlistener_t * | listener, | ||
void * | context | ||
) |
Create a subscription that matches multiple subjects.
nspace | - The namespace that defines the subjects this subscription will receive. |
listener | - The subscription listener that will receive updates to subjects with the supplied ds5_namespace_t. |
context | - A context that is passed to the callback functions of the subscription listener (ds5_subscriptionlistener_t). The structure and contents of this context is application specific. |
void ds5_unsubscribe | ( | ds5_subscription_t * | sub | ) |
Unsubscribe from the DataSource subject or namespace of DataSource subjects.
sub | - The subscription to unsubscribe from. |
Following a call to this function, the associated listener will not recieve any further events to its ds5_subscriptionlistener_t.