XROAD
pos_engine.h File Reference
#include "mdata_proto.h"
#include "mdata_aux.h"
#include <cache/xroad_objects.h>
Include dependency graph for pos_engine.h:

Go to the source code of this file.

Classes

struct  pos_callback_t
 
struct  pos_engine_callback_t
 

Typedefs

typedef struct pos_subs_info_s pos_subs_info_t
 
typedef struct pos_engine_s pos_engine_t
 

Functions

pos_engine_t * pos_server_create (xroad_xml_tag_t cfg, pos_engine_callback_t cb)
 
pos_engine_t * pos_client_create (uint32_t throttle_timeout_us, int32_t wait_timeout_us, int32_t heartbeat_int)
 
xroad_errno_t pos_engine_start (pos_engine_t *pos)
 
void pos_engine_stop (pos_engine_t *pos)
 
void pos_engine_destroy (pos_engine_t *pos)
 
xroad_errno_t pos_engine_send (pos_engine_t *pos, mdata_pos_info_t *data)
 
pos_subs_info_t * pos_engine_subscribe (pos_engine_t *mdata, xroad_portfolio_t *portfolio, xroad_instr_t *instr, xroad_timestamp_t from_ts, xroad_timestamp_t till_ts, pos_callback_t cb)
 
xroad_errno_t pos_engine_unsubscribe (pos_engine_t *md, pos_subs_info_t *info)
 
xroad_errno_t pos_engine_deactivate (pos_engine_t *pos)
 
xroad_errno_t pos_engine_activate (pos_engine_t *pos)
 
xroad_mdsource_t * pos_engine_get_source (pos_engine_t *pos)
 

Detailed Description

Function Documentation

◆ pos_client_create()

pos_engine_t* pos_client_create ( uint32_t  throttle_timeout_us,
int32_t  wait_timeout_us,
int32_t  heartbeat_int 
)

create new pos client-server instance

Parameters
[in]cfg- pos_engine config
Returns
pointer to new instance, NULL - error

◆ pos_engine_destroy()

void pos_engine_destroy ( pos_engine_t *  pos)

destroys pos_engine instance

Parameters
[in]pos- pointer to the pos instance. If NULL, nothing happened

◆ pos_engine_send()

xroad_errno_t pos_engine_send ( pos_engine_t *  pos,
mdata_pos_info_t *  data 
)

publish data in connection

Parameters
[in]pos- pointer to the pos instance
Returns
XROAD_OK if succesed otherwise XROAD_FAILED

◆ pos_engine_start()

xroad_errno_t pos_engine_start ( pos_engine_t *  pos)

starts pos_engine instance and makes it ready for future work

Parameters
[in]pos- pointer to the pos instance
Returns
XROAD_OK if succesed otherwise XROAD_FAILED

◆ pos_engine_stop()

void pos_engine_stop ( pos_engine_t *  pos)

stops pos_engine instance

Parameters
[in]pos- pointer to the pos instance

◆ pos_engine_subscribe()

pos_subs_info_t* pos_engine_subscribe ( pos_engine_t *  mdata,
xroad_portfolio_t *  portfolio,
xroad_instr_t *  instr,
xroad_timestamp_t  from_ts,
xroad_timestamp_t  till_ts,
pos_callback_t  cb 
)

subscribes consumer to updates of particular position request

Parameters
[in]pos- pointer to the pos instance
[in]portfolio- portfolio to subscribe
[in]instr- instrument to subscribe
[in]from_ts- start of period for requested pos
[in]till_ts- end of period for requested pos
[in]cb- pos_callback_t
Returns
pos_subs_info instance if succesed otherwise NULL

◆ pos_engine_unsubscribe()

xroad_errno_t pos_engine_unsubscribe ( pos_engine_t *  md,
pos_subs_info_t *  info 
)

unsubscribes consumer from particular updates of position request

Parameters
[in]pos- pointer to the pos instance
[in]info- pointer to pos_subs_info_t
Returns
XROAD_OK if succesed otherwise XROAD_FAILED

◆ pos_server_create()

pos_engine_t* pos_server_create ( xroad_xml_tag_t  cfg,
pos_engine_callback_t  cb 
)

create new pos client-server instance

Parameters
[in]cfg- pos_engine config
Returns
pointer to new instance, NULL - error