dxFeed C API  6.0.1
dxFeed C API library intended to provide market data access for DX clients
Functions
Listeners

API event listeners management functions. More...

Collaboration diagram for Listeners:

Functions

DXFEED_API ERRORCODE dxf_attach_event_listener (dxf_subscription_t subscription, dxf_event_listener_t event_listener, void *user_data)
 Attaches a listener callback to the subscription. More...
 
DXFEED_API ERRORCODE dxf_detach_event_listener (dxf_subscription_t subscription, dxf_event_listener_t event_listener)
 Detaches a listener from the subscription. More...
 
DXFEED_API ERRORCODE dxf_attach_event_listener_v2 (dxf_subscription_t subscription, dxf_event_listener_v2_t event_listener, void *user_data)
 Attaches a extended listener callback to the subscription. More...
 
DXFEED_API ERRORCODE dxf_detach_event_listener_v2 (dxf_subscription_t subscription, dxf_event_listener_v2_t event_listener)
 Detaches a extended listener from the subscription. More...
 
DXFEED_API ERRORCODE dxf_get_subscription_event_types (dxf_subscription_t subscription, OUT int *event_types)
 Retrieves the subscription event types. More...
 
DXFEED_API ERRORCODE dxf_get_last_event (dxf_connection_t connection, int event_type, dxf_const_string_t symbol, OUT dxf_event_data_t *event_data)
 Retrieves the last event data of the specified symbol and type for the connection. More...
 
dxf_const_string_t dx_event_type_to_string (int event_type)
 Converts event type code to its string representation. More...
 
int dx_get_event_data_struct_size (int event_id)
 Get event data structure size for given event id. More...
 
dx_event_id_t dx_get_event_id_by_bitmask (int event_bitmask)
 Get event id by event bitmask. More...
 
const dxf_event_data_t dx_get_event_data_item (int event_mask, dxf_const_event_data_t data, size_t index)
 Get event data item from event data. More...
 

Detailed Description

API event listeners management functions.

Function Documentation

◆ dx_event_type_to_string()

dxf_const_string_t dx_event_type_to_string ( int  event_type)

Converts event type code to its string representation.

Parameters
event_typeEvent type code
Returns
String representation of event type

◆ dx_get_event_data_item()

const dxf_event_data_t dx_get_event_data_item ( int  event_mask,
dxf_const_event_data_t  data,
size_t  index 
)

Get event data item from event data.

Parameters
event_maskEvent mask
dataEvent data
indexEvent data item index
Returns
Event data item

◆ dx_get_event_data_struct_size()

int dx_get_event_data_struct_size ( int  event_id)

Get event data structure size for given event id.

Parameters
event_idEvent id
Returns
Data structure size

◆ dx_get_event_id_by_bitmask()

dx_event_id_t dx_get_event_id_by_bitmask ( int  event_bitmask)

Get event id by event bitmask.

Parameters
event_bitmaskEvent bitmask
Returns
Event id

◆ dxf_attach_event_listener()

DXFEED_API ERRORCODE dxf_attach_event_listener ( dxf_subscription_t  subscription,
dxf_event_listener_t  event_listener,
void *  user_data 
)

Attaches a listener callback to the subscription.

This callback will be invoked when the new event data for the subscription symbols arrives. No error occurs if it's attempted to attach the same listener twice or more.

Parameters
[in]subscriptionA handle of the subscription to which a listener is to be attached
[in]event_listenerA listener callback function pointer
[in]user_dataData to be passed to the callback function
Returns
DXF_SUCCESS on successful event listener attachment or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_attach_event_listener_v2()

DXFEED_API ERRORCODE dxf_attach_event_listener_v2 ( dxf_subscription_t  subscription,
dxf_event_listener_v2_t  event_listener,
void *  user_data 
)

Attaches a extended listener callback to the subscription.

This callback will be invoked when the new event data for the subscription symbols arrives. No error occurs if it's attempted to attach the same listener twice or more. This listener differs with extend number of callback parameters.

Parameters
[in]subscriptionA handle of the subscription to which a listener is to be attached
[in]event_listenerA listener callback function pointer
[in]user_dataData to be passed to the callback function; if there isn't user data pass NULL
Returns
DXF_SUCCESS on successful event listener attachment or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_detach_event_listener()

DXFEED_API ERRORCODE dxf_detach_event_listener ( dxf_subscription_t  subscription,
dxf_event_listener_t  event_listener 
)

Detaches a listener from the subscription.

No error occurs if it's attempted to detach a listener which wasn't previously attached.

Parameters
[in]subscriptionA handle of the subscription from which a listener is to be detached
[in]event_listenerA listener callback function pointer
Returns
DXF_SUCCESS on successful event listener detachment or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_detach_event_listener_v2()

DXFEED_API ERRORCODE dxf_detach_event_listener_v2 ( dxf_subscription_t  subscription,
dxf_event_listener_v2_t  event_listener 
)

Detaches a extended listener from the subscription.

No error occurs if it's attempted to detach a listener which wasn't previously attached.

Parameters
[in]subscriptionA handle of the subscription from which a listener is to be detached
[in]event_listenerA listener callback function pointer
Returns
DXF_SUCCESS on successful event listener detachment or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_get_last_event()

DXFEED_API ERRORCODE dxf_get_last_event ( dxf_connection_t  connection,
int  event_type,
dxf_const_string_t  symbol,
OUT dxf_event_data_t event_data 
)

Retrieves the last event data of the specified symbol and type for the connection.

Parameters
[in]connectionA handle of the connection whose data is to be retrieved
[in]event_typeAn event type bitmask defining a single event type
[in]symbolA symbol name
[out]event_dataA pointer to the variable to which the last data buffer pointer is stored; if there was no data for this connection/event type/symbol, NULL will be stored
Returns
DXF_SUCCESS on successful event retrieval or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_get_subscription_event_types()

DXFEED_API ERRORCODE dxf_get_subscription_event_types ( dxf_subscription_t  subscription,
OUT int *  event_types 
)

Retrieves the subscription event types.

Parameters
[in]subscriptionA handle of the subscription whose event types are to be retrieved
[out]event_typesA pointer to the variable to which the subscription event types bitmask is to be stored
Returns
DXF_SUCCESS on successful event types retrieval or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;