Transformer SDK For C  6.2.11.309924
datasrc.h File Reference

Go to the source code of this file.

Data Structures

struct  _ds5_namespace_s
 Definition of the interface that you should implement if you require custom subject matching logic. More...
 
struct  _ds_data
 A data update object. More...
 
struct  _ds_field
 A field within a data update. More...
 
struct  ds5_connectionlistener_t
 
struct  ds5_dataprovider_t
 
struct  ds5_subscriptionlistener_t
 
struct  ds_arguments_t
 Structure defining the arguments for Monitoring methods. More...
 
struct  ds_array_t
 The container object for monitoring array types. More...
 
struct  ds_config_enum_t
 Enumerated types structure. More...
 
struct  ds_init_t
 
struct  ds_monauth_t
 Monitoring credentials object. More...
 
struct  ds_monitor_t
 The container object for all monitoring values. More...
 

Macros

#define ds5_namespace_free(nspace)   nspace->free(nspace)
 A convenience macro for invoking the ds5_namespace_t::delete() function on a namespace. More...
 
#define ds5_namespace_match(nspace, subject)   nspace->match(nspace, subject)
 A convenience macro for invoking the ds5_namespace_t::match() function on a namespace. More...
 
#define DS_AND(p1, p2, a)
 Combine two peersets using bitwise and. More...
 
#define DS_AND3_ISZERO(p1, p2, p3)
 Test if the bitwise and of 3 peersets is 0. More...
 
#define DS_AND_ISZERO(p1, p2)
 Test if the bitwise and of 2 peersets is 0. More...
 
#define DS_CACHE_DATASRC
 Peer index of cache datasrc. More...
 
#define DS_CLR(n, p)
 Clears peer n in peerset p. More...
 
#define DS_CONFIG_BOOL   0x0001
 
#define DS_CONFIG_CHAR   0x0005
 
#define DS_CONFIG_CHAR_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_CHAR)
 
#define DS_CONFIG_DEPRECATED   0x0400
 
#define DS_CONFIG_FILE   0x0007
 
#define DS_CONFIG_FLOAT   0x0003
 
#define DS_CONFIG_FLOAT_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_FLOAT)
 
#define DS_CONFIG_FUNC   0x0006
 
#define DS_CONFIG_INT   0x0002
 
#define DS_CONFIG_INT_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_INT)
 
#define DS_CONFIG_STR   0x0004
 
#define DS_CONFIG_STR_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_STR)
 
#define DS_CONFIG_STRICT   0x0200
 
#define DS_CONTAINER_TYPE   228
 Define the container data type. More...
 
#define DS_FIELDS_NOT_DEFINED
 Value returned by field API functions when a field is not defined. More...
 
#define DS_FIELDS_SEPARATOR
 Defines the separator between multiple type 2/type 3 or permission row updates within a single packet. More...
 
#define DS_GENERIC_TYPE   231
 Define the generic object data type. More...
 
#define DS_INITIALISER
 Default initialiser for the ds_init_t object. More...
 
#define DS_INTERNAL_DATASRC
 Peer index of internal datasrc. More...
 
#define DS_ISEQUAL(p1, p2)
 Test if 2 peersets are equal. More...
 
#define DS_ISSET(n, p)
 Tests whether peer n in peerset p. More...
 
#define DS_ISZERO(p)
 Checks if all peers in peerset p are cleared. More...
 
#define DS_LOG_CONFIG   0
 Used for log messages that indicate a problem or feedback with library configuration. More...
 
#define DS_LOG_CRIT   2
 Used for log messages that indicate a serious failure. More...
 
#define DS_LOG_DEBUG   7
 Used for tracing messages. More...
 
#define DS_LOG_ERROR   3
 Used for log messages that indicate a problem. More...
 
#define DS_LOG_FINER   8
 Used for fairly detailed tracing messages. More...
 
#define DS_LOG_FINEST   9
 Used for the most finely detailed tracing messages. More...
 
#define DS_LOG_INFO   6
 Used for informational messages. More...
 
#define DS_LOG_MONITOR   128
 A modifier that will send the log message to the monitoring system in addition to the event log, even if the log level is below the monitoring threshold value. More...
 
#define DS_LOG_NOTIFY   4
 Used for messages of greater importance than DS_LOG_WARN that may not indicate problems. More...
 
#define DS_LOG_SYSLOG   512
 A modifier which will write the log message to the system log in addition to the event log. More...
 
#define DS_LOG_TERMINAL   256
 A modifier which will write the log message to the terminal in addition to the event log. More...
 
#define DS_LOG_WARN   5
 Used for messages that indicate a potential problem. More...
 
#define DS_MAX_PEERS
 Maximum number of peers. More...
 
#define DS_MIN_PEER
 Minimum index for configured peer. More...
 
#define DS_MSG_CONNECT   0x0100
 Defines the connect message type. More...
 
#define DS_MSG_DISCONNECT   0x0200
 Defines the disconnect message type. More...
 
#define DS_NEWS_TYPE   223
 Define the news headline data type. More...
 
#define DS_NONZERO(p)
 Sets all peers in peerset p. More...
 
#define DS_OFFSET(t, m)
 
#define DS_OR(p1, p2, o)
 Combine two peersets using bitwise or. More...
 
#define DS_PAGE_TYPE   221
 Define the page data type. More...
 
#define DS_PERMISSION_TYPE   230
 Define the permission data type. More...
 
#define DS_RECORD_TYPE   222
 Define the record data type. More...
 
#define DS_RECORD_TYPE2   225
 Define the type 2 record (market depth) data type. More...
 
#define DS_RECORD_TYPE3   226
 Define the type 3 record (history) data type. More...
 
#define DS_REQUEST_CACHE
 Flag indicating that this request is a result of a request from the active cache. More...
 
#define DS_REQUEST_FAILOVER
 Flag indicated that this request is as a result of a failover between peers. More...
 
#define DS_SET(n, p)
 Sets peer n in peerset p. More...
 
#define DS_SIGNATURE_ALREADY_USED   3
 
#define DS_SIGNATURE_INVALID_TOKEN   1
 
#define DS_SIGNATURE_OK   0
 
#define DS_SIGNATURE_UNKNOWN_KEYID   2
 
#define DS_STORY_TYPE   224
 Define the news story data type. More...
 
#define DS_T_ACTIVE
 Defines the active source peer type, which can accept requests for objects. This flag could be set on the DataSource initialisation object ds_init_t or set in the add-peer sections of a configuration file. More...
 
#define DS_T_CONTRIB
 Defines the contribution peer type. This source should automatically receive data updates for objects that it has updated itself. This flag could be set on the DataSource initialisation object ds_init_t or set in the add-peer sections of a configuration file. More...
 
#define DS_ZERO(p)
 Unsets all peers in peerset p. More...
 
#define F_AUTHGLOBAL   0x0100
 Indicates that this update for an object (initially permission objects only) should be passed up to the auth module. More...
 
#define F_AUTHUPDATE   0x4000
 This news update contains permissioning information. More...
 
#define F_CHANGE_HEADLINE   0x0200
 Change the headline associated with the story code in this update to the headline contained in this update. More...
 
#define F_CHANGEDFIELDS   0x8000
 Tells the liberator to only send on any changed fields. This tells the liberator compare this update with the cached data and only send on any changed fields to any subscribers. See the Liberator Admin Guide for details. More...
 
#define F_CLEAR_PERM   0x0400
 Clear all permission keys for this update's symbolname. More...
 
#define F_CLEAR_TYPE2   0x0400
 Clear all record type 2 entries for this update's symbolname. More...
 
#define F_CLEAR_TYPE3   0x0100
 Clear all record type 3 entries this update's symbolname. More...
 
#define F_CONSTITUENT_NOAUTH   0x4000
 The constituents in this container should noe be subject to permissioning. More...
 
#define F_CREATEOBJECT   0x0010
 Create this object if it doesn't exist. More...
 
#define F_CREATEPARENT   0x0020
 Create the parent directory if it doesn't exist. More...
 
#define F_DELETE_HEADLINE   0x0100
 Delete the headline associated with the story code in this update. More...
 
#define F_DELETEOBJECT   0x0004
 Instruction to delete this object. More...
 
#define F_FILTER_PERM   0x0800
 Clears a permission key with the same value as the key fields present within this update. More...
 
#define F_FILTER_TYPE2   0x0800
 Clears type 2 entries with the same value as the first field in this update. More...
 
#define F_FILTER_TYPE3   0x0200
 Clears a type 3 entries with the same value as the first field in this update. More...
 
#define F_IGNOREREQTIMEOUT   0x0008
 Allow nodata to be propagated. More...
 
#define F_IMAGE   0x1000
 This update is an image not a live update. All fields will be replaced by this update. More...
 
#define F_NOCACHE   0x0400
 Do not cache this update - pass directly through to client. More...
 
#define F_NOCONNECT
 Suppresses the automatic connection to DataSource peers on startup. The connection can then be made later using ds_set_status_up(). More...
 
#define F_NONACTIVE   0x2000
 This object is not active, even if the DataSource is. For information on active data sources,. More...
 
#define F_NOTFOUND   0x0001
 The object is not found. More...
 
#define F_READDENY   0x0002
 You do not have permission to read this object. More...
 
#define F_RECVAUTOREPLAY
 Defines the Receive Auto Replay peer flag (indicating that, when restarting, this peer should accept replay updates). More...
 
#define F_SENDFROMSEQ
 Defines the Send From Sequence peer flag (indicating that, when reconnecting, missed packets should be requested based on the last sequence number). More...
 
#define F_UNAVAILABLE   0x0005
 The object is unavailable at this time. More...
 
#define F_WRITEDENY   0x0003
 You do not have permission to write to this object. More...
 
#define INVALID_SOCKET   -1
 A constant representing an invalid socket. More...
 
#define NEWS_AUTHSTR_FIELDNUM   5
 Definition of the authorisation string field number. More...
 
#define NEWS_COMPANY_CODE_FIELDNUM   102
 Definition of the company code field number. More...
 
#define NEWS_DATETIME_FIELDNUM   2
 Definition of the date time field number. More...
 
#define NEWS_HEADLINE_FIELDNUM   0
 Definition of the headline field number. More...
 
#define NEWS_PRODUCT_CODE_FIELDNUM   100
 Definition of the product code field number. More...
 
#define NEWS_STORYCODE_FIELDNUM   1
 Definition of the storycode field number. More...
 
#define NEWS_TOPIC_CODE_FIELDNUM   101
 Definition of the topic code field number. More...
 
#define NEWS_USER_CODE_FIELDNUM   200
 Definition of the user code starting field number. More...
 
#define NEWS_USER_CODE_MAX   10
 Maximum number of user codes. More...
 
#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...
 
#define S_FAILOVER   0x1101 /* Failover implies S_STALE|S_UPDCLR */
 Indicates the object may not be receiving updates any more. More...
 
#define S_INFO   0x0000
 This is an information only status message. More...
 
#define S_NOTSTALE   0x0004
 This indicates that an object is no longer stale and is receiving updates again. More...
 
#define S_STALE   0x0001
 This indicates the object may not be receiving updates any more. More...
 
#define S_UPDCLR   0x0100
 This indicates an update to this object should clear the previously-sent S_STALE or S_NOTSTALE message. More...
 
#define SOCKET_ERROR   -1
 A constant representing an error on a socket. More...
 
#define SVC_STATUS_DOWN   0x0002
 The status of a data service is down. More...
 
#define SVC_STATUS_LIMITED   0x0008
 The status of a data service is limited. More...
 
#define SVC_STATUS_OK   0x0001
 The status of a data service is OK. More...
 
#define TYPE_ACTIVE   64
 Indicates whether the datatype is "active". More...
 
#define TYPE_ACTIVE2   128
 Indicates whether the active type isn't a callback. More...
 
#define TYPE_ARRAY   32
 Indicates whether the datatype is an array. More...
 
#define TYPE_BINARY   1
 Binary property type. More...
 
#define TYPE_BOOLEAN   11
 Boolean property type. More...
 
#define TYPE_DOUBLE   9
 Double property type. More...
 
#define TYPE_HIERARCHY   1024
 Indicates whether this data forms part of a heirarchy. More...
 
#define TYPE_KEY   512
 Indicates whether this datatype forms part of the primary key. More...
 
#define TYPE_LLONG   7
 Long long property type. More...
 
#define TYPE_LONG   5
 Long property type. More...
 
#define TYPE_METHOD   256
 Indicates whether this datatype is a method. More...
 
#define TYPE_NONE   0
 A place marker. More...
 
#define TYPE_OPTIONAL   2048
 
#define TYPE_PRIMITIVE_MASK   31
 Mask to isolate the primitive data type. More...
 
#define TYPE_RELATION   20
 Indicates that the property is a relation. More...
 
#define TYPE_SHORT   3
 Short property type. More...
 
#define TYPE_STRING   2
 String property type. More...
 
#define TYPE_SUBSCRIPTION   21
 Indicates that the property is a subscription list. More...
 
#define TYPE_TIMESTAMP   10
 Timestamp property type. More...
 
#define TYPE_ULLONG   8
 Unsigned long long property type. More...
 
#define TYPE_ULONG   6
 Unsigned long property type. More...
 
#define TYPE_USHORT   4
 Unsigned short property type. More...
 

Typedefs

typedef struct _ds5_namespace_s ds5_namespace_t
 Typedef to the definition of the interface for defining DataSource namespaces. More...
 
typedef struct _ds5_publisher_s ds5_publisher_t
 
typedef struct _ds5_subscription_s ds5_subscription_t
 
typedef struct _config_ctx ds_config_ctx_t
 The configuration context data type. More...
 
typedef void(* ds_config_func) (char *name, int num, char **values)
 Definition of function type used for configuration callbacks. More...
 
typedef void(* ds_delay_send_cb) (void *context, ds_data_t *dsdata)
 
typedef struct _ds_delay ds_delay_t
 The delay channel object type. More...
 
typedef struct _ds_io_event ds_except_event_t
 Opaque type defining an exception event. More...
 
typedef struct _ds_io_event ds_generic_event_t
 Opaque type defining a generic read/write event. More...
 
typedef int(* ds_io_event_cb) (sock_t sock, int val, void *data)
 Definition of the callback for use with read and write events. More...
 
typedef struct _ds_log ds_log_t
 The log file object. More...
 
typedef void(* ds_logcycled_t) (ds_log_t *log)
 Callback used when the log has cycled. More...
 
typedef void(* ds_loglevelchange_t) (ds_log_t *log, int new_level)
 Callback used when the logging level of a log file is changed. More...
 
typedef ds_monitor_t *(* ds_monitor_active_cb) (char *templatename, char *key, char *propertyname)
 Definition of the function type used for active request callbacks. More...
 
typedef int(* ds_monitor_authenticator_t) (ds_monauth_t *credentials)
 Definition of the function type used for monitoring authentication callback. More...
 
typedef ds_monitor_t *(* ds_monitor_method_cb) (char *templatename, char *key, char *property, int argc, char *argv[])
 Definition of the function type used for method calls. More...
 
typedef struct _ds_io_event ds_read_event_t
 Opaque type defining a read event. More...
 
typedef struct _ds_peer_set ds_set_t
 Defines a set of DataSource peers. More...
 
typedef int(* ds_timed_event_cb) (int id, int val, void *data)
 Definition of the callback for use with timed events. More...
 
typedef struct _ds_timed_event ds_timed_event_t
 Opaque type defining a timed event. More...
 
typedef int(* ds_udp_event_cb) (int argc, char *argv[], int val, void *data)
 Definition of the callback for use with udp events. More...
 
typedef struct _ds_udp_event ds_udp_event_t
 Opaque type defining a udp event. More...
 
typedef struct _ds_io_event ds_write_event_t
 Opaque type defining a write event. More...
 
typedef void(* recv_discard_t) (int peer, int count, char **subjects, unsigned short flags)
 
typedef void(* recv_map_t) (int peer, char *from, char *to)
 
typedef void(* recv_nodata_t) (int peer, char *subject, unsigned short flags)
 
typedef void(* recv_object_status_t) (int peer, char *subject, int status, unsigned short code, char *msgstr)
 
typedef void(* recv_peer_status_t) (int peer, int status, int val, void *data)
 
typedef void(* recv_replay_t) (int peer, ds_data_t *pkt, time_t tm)
 
typedef void(* recv_request_t) (int peer, int count, char **subjects, unsigned short flags)
 
typedef void(* recv_service_status_t) (char *service, int status)
 
typedef void(* recv_update_t) (int peer, ds_data_t *pkt)
 
typedef int sock_t
 The network socket datatype. More...
 

Functions

DATASRCAPI void ds_add_latency_chain (ds_data_t *dsdata, char suffix, int64_t millis)
 function used to add a measurement point to latency chain data More...
 
DATASRCAPI void ds_add_latency_chain2 (ds_data_t *dsdata, char suffix, int64_t millis, char suffix2, int64_t millis2)
 function used to add two measurement points to latency chain data More...
 
DATASRCAPI int ds_set_request_hint (const char *name, int num, char **hints)
 

Detailed Description

Main DataSource include file

Macro Definition Documentation

#define DS_INITIALISER

Default initialiser for the ds_init_t object.

#define DS_MSG_CONNECT   0x0100

Defines the connect message type.

This parameter is sent to the ds5_connectionlistener_t::peer_status() callback function when a DataSource peer connection has been established.

#define DS_MSG_DISCONNECT   0x0200

Defines the disconnect message type.

This parameter is sent to the ds5_connectionlistener_t::peer_status() callback function when a DataSource peer connection has been lost.

#define DS_REQUEST_CACHE

Flag indicating that this request is a result of a request from the active cache.

If a DataSource receives a call to the recv_request() callback with this flag set then the source should send the data related to these objects as broadcast data so that they are picked up by the active cache.

#define DS_REQUEST_FAILOVER

Flag indicated that this request is as a result of a failover between peers.

If a DataSource receives receives a call to the recv_request() callback with this bit set then the sink knows that the object exists and the source should not respond with a nodata message unless it is confident that the object does not exist

#define DS_SIGNATURE_ALREADY_USED   3
#define DS_SIGNATURE_INVALID_TOKEN   1
#define DS_SIGNATURE_OK   0
#define DS_SIGNATURE_UNKNOWN_KEYID   2
#define F_IGNOREREQTIMEOUT   0x0008

Allow nodata to be propagated.

This define is used as the flags argument to ds5_publish_subject_error().

#define OBJ_STATUS_INFO   0x0000

Status information message only.

#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.

#define OBJ_STATUS_OK   0x0001

The status of an object is OK.

#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.

#define S_FAILOVER   0x1101 /* Failover implies S_STALE|S_UPDCLR */

Indicates the object may not be receiving updates any more.

  • use an alternative DataSource if possible.

    This status is one that can be sent by an application that sends data, however on the receiving side it is handled by the DataSource library, before being passed on to the application.

    This define is used as the flags parameter for ds_send_status() and ds_send_status_to_peer().

#define S_INFO   0x0000

This is an information only status message.

This status is one that can be sent by an application that sends data, or handled by an application that receives data.

This define is used as the flags parameter for ds_send_status() and ds_send_status_to_peer() or received in a recv_object_status() callback

#define S_NOTSTALE   0x0004

This indicates that an object is no longer stale and is receiving updates again.

This status is one that can be sent by an application that sends data, or handled by an application that receives data.

This define is used as the flags parameter for ds_send_status() and ds_send_status_to_peer().

#define S_STALE   0x0001

This indicates the object may not be receiving updates any more.

This status is one that can be sent by an application that sends data, or handled by an application that receives data.

This define is used as the flags parameter for ds_send_status() and ds_send_status_to_peer().

#define S_UPDCLR   0x0100

This indicates an update to this object should clear the previously-sent S_STALE or S_NOTSTALE message.

The S_UPDCLR flag should be sent at the same time as the S_STALE or S_NOTSTALE message.

This status is one that can be sent by an application that sends data, or handled by an application that receives data.

This define is used as the flags parameter for ds_send_status() and ds_send_status_to_peer().

#define SVC_STATUS_DOWN   0x0002

The status of a data service is down.

One or more required sources for this data service are down.

This is a status used by the DataSource library for the ds5_connectionlistener_t::service_status() callback. All applications will receive these status callbacks.

#define SVC_STATUS_LIMITED   0x0008

The status of a data service is limited.

One or more non-required sources for this data service are down.

This is a status used by the DataSource library for the ds5_connectionlistener_t::service_status() callback. All applications will receive these status callbacks.

#define SVC_STATUS_OK   0x0001

The status of a data service is OK.

All required sources for this data service are connected.

This is a status used by the DataSource library for the ds5_connectionlistener_t::service_status() callback. All applications will receive these status callbacks.

#define TYPE_SUBSCRIPTION   21

Indicates that the property is a subscription list.

Typedef Documentation

typedef struct _ds5_publisher_s ds5_publisher_t
typedef struct _ds5_subscription_s ds5_subscription_t
typedef void(* ds_delay_send_cb) (void *context, ds_data_t *dsdata)
typedef struct _ds_delay ds_delay_t

The delay channel object type.

typedef void(* recv_discard_t) (int peer, int count, char **subjects, unsigned short flags)
typedef void(* recv_map_t) (int peer, char *from, char *to)
typedef void(* recv_nodata_t) (int peer, char *subject, unsigned short flags)
typedef void(* recv_object_status_t) (int peer, char *subject, int status, unsigned short code, char *msgstr)
typedef void(* recv_peer_status_t) (int peer, int status, int val, void *data)
typedef void(* recv_replay_t) (int peer, ds_data_t *pkt, time_t tm)
typedef void(* recv_request_t) (int peer, int count, char **subjects, unsigned short flags)
typedef void(* recv_service_status_t) (char *service, int status)
typedef void(* recv_update_t) (int peer, ds_data_t *pkt)

Function Documentation

DATASRCAPI void ds_add_latency_chain ( ds_data_t dsdata,
char  suffix,
int64_t  millis 
)

function used to add a measurement point to latency chain data

Parameters
dsdata- ds_data_t object to be modified. The object needs to have the initial timestamp field set.
suffix- server name suffix for the timestamp to be used for the generated hop name.
millis- millisecond timestamp to be added or 0 for current time.
DATASRCAPI void ds_add_latency_chain2 ( ds_data_t dsdata,
char  suffix,
int64_t  millis,
char  suffix2,
int64_t  millis2 
)

function used to add two measurement points to latency chain data

Parameters
dsdata- ds_data_t object to be modified. The object needs to have the initial timestamp field set.
suffix- server name suffix for the first timestamp to be used for the generated hop name
millis- millisecond timestamp to be added. Must be a valid timestamp and cannot be 0.
suffix2- server name suffix for the second timestamp to be used for the generated hop name.
millis2- millisecond timestamp to be added or 0 for current time.
DATASRCAPI int ds_set_request_hint ( const char *  name,
int  num,
char **  hints 
)

Generated on Sat Aug 26 2017 12:36:32 for Transformer SDK For C