DataSource for C SDK  8.0.1.207118-0de6d82f
DataSource namespaces

Data Structures

struct  _ds5_namespace_s
 Definition of the interface that you should implement if you require custom subject matching logic. 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...
 

Typedefs

typedef struct _ds5_namespace_s ds5_namespace_t
 Typedef to the definition of the interface for defining DataSource namespaces. More...
 

Functions

ds5_namespace_tds5_create_globbed_namespace (const char *globbed)
 Creates a DataSource namespace which will match subject names using globbing. More...
 
ds5_namespace_tds5_create_prefix_namespace (const char *prefix)
 Creates a DataSource namespace which will match subject names based on their prefix. More...
 
ds5_namespace_tds5_create_regex_namespace (const char *expr)
 Creates a DataSource namespace which will match subject names using a regular expression. More...
 
int ds5_regex_namespace_add_expr (ds5_namespace_t *nspace, const char *expr, int exclude)
 Adds a regular expression to a namespace. More...
 

Detailed Description

A namespace is used to determine whether a subject is of interest to either a ds5_dataprovider_t or to a ds5_subscription_t. A subject name is defined within a particular DataSource namespace. For example, if the DataSource namespace is the prefix "/FX" the subject name "/FX/EURUSD" is within that namespace, but the subject name "/FY/EURUSD" is not. The interface that represents a DataSource namespace is ds5_namespace_t.

A ds5_namespace_t is used to construct a ds5_publisher_t and to ensure that the associated ds5_dataprovider_t only receives requests for subjects that it can supply.

DataSource for C provides implementations of prefix based, regex (with inclusions and exclusions) and "filename" globbing implementation ofs the ds5_namespace_t interface. These will generally cover most usecase, however if you wish to implement more custom algorithms, then you can write your open implementaton of ds5_namespace_t.

Macro Definition Documentation

#define ds5_namespace_free (   nspace)    nspace->free(nspace)

A convenience macro for invoking the ds5_namespace_t::delete() function on a namespace.

Parameters
nspace- The namespace to be deleted.
#define ds5_namespace_match (   nspace,
  subject 
)    nspace->match(nspace, subject)

A convenience macro for invoking the ds5_namespace_t::match() function on a namespace.

Parameters
nspace- The namespace.
subject- The subject to match.
Return values
0- The subject matches.
!0- The subject does not match.

Typedef Documentation

Typedef to the definition of the interface for defining DataSource namespaces.

Function Documentation

ds5_namespace_t* ds5_create_globbed_namespace ( const char *  globbed)

Creates a DataSource namespace which will match subject names using globbing.

Parameters
globbed- The glob pattern to match against.
Returns
A new DataSource namespace that will match subject names against the supplied pattern.
ds5_namespace_t* ds5_create_prefix_namespace ( const char *  prefix)

Creates a DataSource namespace which will match subject names based on their prefix.

Parameters
prefix- The prefix to test subject names against.
Returns
A new DataSource namespace that will match subject names against the supplied prefix.
ds5_namespace_t* ds5_create_regex_namespace ( const char *  expr)

Creates a DataSource namespace which will match subject names using a regular expression.

Parameters
expr- Regular expression
Returns
A new DataSource namespace that will match subject names against the supplied expr.
Note
If expr == NULL, then you need to call ds5_regex_namespace_add_expr() to add regular expressions.
int ds5_regex_namespace_add_expr ( ds5_namespace_t nspace,
const char *  expr,
int  exclude 
)

Adds a regular expression to a namespace.

Parameters
nspace- The Regex namespace to add the regular expression to
expr- The regular expression to add
exclude- Zero if expr should be a match, non-zero if not
Return values
0- Successfully added
-1- Invalid expression
-2- nspace is not a regular expression namespace

When matching is performed, a match of any exclude pattern will override a match of any include pattern.


Generated on Fri Feb 23 2024 14:56:09 for DataSource for C SDK