Transformer SDK For C  6.2.11.309924
Cache Operations

Macros

#define CMD_SYMBOL_DEL_PKTS
 Delete a symbol from the cache. More...
 

Functions

int symbol_create (const char *name, unsigned int flags)
 Create a new symbol within the Transformer memory. More...
 
void symbol_delete_all_mmaker (const char *name)
 Delete all the Type 2 data associated with a symbol. More...
 
void symbol_delete_all_permission_keys (const char *name)
 Delete all the data associated with a permission object. More...
 
void symbol_delete_mmaker (const char *name, const char *mmaker)
 Delete the data associated with a type 2 index. More...
 
void symbol_delete_permission_key (const char *name, const char *key)
 Delete the data associated with a permission key. More...
 
void symbol_delete_type2 (const char *name, const char *index, int fieldnum)
 Delete the data associated with a type 2 index. More...
 
int symbol_get_type (const char *objname)
 Return the type of a particular object. More...
 
char ** symbol_historic_field (const char *name, int fieldnum, int *number)
 Get all data for a particular field number within a symbol. More...
 
char * symbol_last_field (const char *name, int fieldnum)
 Return the last received fieldvalue for a symbol. More...
 
char * symbol_last_field_byname (const char *name, const char *field)
 Return the last recieved fieldvalue for a symbol. More...
 
ds_data_tsymbol_last_mmaker_update (const char *name, const char *mmaker)
 Returns the currently cached Type 2 data for a symbol/Type 2 index. More...
 
ds_data_tsymbol_last_permission_update (const char *name, const char *key)
 Returns the currently cached permission object data. More...
 
ds_data_tsymbol_last_update (const char *name)
 Returns the currently cached Type 1 data for a symbol. More...
 
time_t symbol_last_updatetime (const char *name)
 Return the time that the last update was received for this symbol. More...
 
char ** symbol_match (const char *name, int *number)
 Return a list of symbols matching the specifier. More...
 
char ** symbol_match_bytype (const char *name, int type, int *number)
 Return a list of symbols matching the pattern and of the specified type. More...
 
char ** symbol_return_mmakers (const char *name, int *num)
 Returns a list of all the cached Type 2 market makers. More...
 
char ** symbol_return_permission_keys (const char *name, int *num)
 Returns a list of all the cached permission object keys. More...
 
int tf_symbol_get_status (const char *name, char **status_message_ptr)
 Return the status for an object within the cache. More...
 
int tf_symbol_get_type (const char *objname)
 Return the type of a particular object. More...
 
char ** tf_symbol_match (const char *name, int *number)
 Return a list of symbols matching the specifier. More...
 
char ** tf_symbol_match_bytype (const char *pattern, int type, int *number)
 Return a list of symbols matching the pattern and of the specified type. More...
 
void tf_symbol_send_status (const char *name, int status, const char *message)
 Send a status message for an object within the cache. More...
 

Detailed Description

The Transformer maintains a cache containing the most recent values of an object. The values contained within the cache can be inspected/modified by a module

Macro Definition Documentation

#define CMD_SYMBOL_DEL_PKTS

Delete a symbol from the cache.

This message will delete a symbol from the cache. A message will be propogated through to an interested modules.

See also
symbol_send_nodata()

Function Documentation

int symbol_create ( const char *  name,
unsigned int  flags 
)

Create a new symbol within the Transformer memory.

Parameters
nameSymbol name
flagsFlags to create the object with see FIXME
Return values
1- already exists
0- successfully created
-1- couldn't create object

If this function returns 1, then the flags on the symbol will be set according to the flags supplied to this function.

Examples:
demo-modify.c.
void symbol_delete_all_mmaker ( const char *  name)

Delete all the Type 2 data associated with a symbol.

Parameters
nameName of the symbol
void symbol_delete_all_permission_keys ( const char *  name)

Delete all the data associated with a permission object.

Parameters
nameName of the symbol
void symbol_delete_mmaker ( const char *  name,
const char *  mmaker 
)

Delete the data associated with a type 2 index.

Parameters
nameName of the symbol
mmakerThe Type 2 index

This function assumes that the fieldnamed "MktMkrId" exists and that it maps through to the Secondary Index.

void symbol_delete_permission_key ( const char *  name,
const char *  key 
)

Delete the data associated with a permission key.

Parameters
nameName of the symbol
keyThe key

The tables below show some sample permission object data that may be cached for the object /LO/CAPLIN. The first table shows data that is available before the call symbol_delete_permission_key("/LO/CAPLIN", "NYC") is made. The second table shows the data that is available afterwards.

Before symbol_delete_permission_key("/LO/CAPLIN", "NYC") is called:

Key  BidTier1  BidTier2  BidTier3
LON 1.01 1.05 1.1
NYC 1.1 1.15 1.2
SGP 1.2 1.25 1.3

After symbol_delete_permission_key("/LO/CAPLIN", "NYC") is called:

Key  BidTier1  BidTier2  BidTier3
LON 1.01 1.05 1.1
SGP 1.2 1.25 1.3
void symbol_delete_type2 ( const char *  name,
const char *  index,
int  fieldnum 
)

Delete the data associated with a type 2 index.

Parameters
nameName of the symbol
indexThe type 2 index
fieldnumThe field number under which type 2 entries are indexed

The tables below show some sample type 2 data that may be cached for the object /LO/CAPLIN, with the type 2 indices stored under the field MARKET_MAKER_ID (field number 212). The first table shows the type 2 data that is available before the call deleteType2("/LO/CAPLIN", "BRC", 212) is made. The second table shows the data that is available afterwards.

Before symbol_delete_type2("/LO/CAPLIN", "BRC", 212) is called:

MARKET_MAKER_ID BIDSIZE BID ASK ASKSIZE 
BRC 1000 52 1/2 54 750
GBN 500 53 54 1000
TLT 1000 53 53 3/4 1000

After symbol_delete_type2("/LO/CAPLIN", "BRC", 212) is called:

MARKET_MAKER_ID BidSize Bid Ask AskSize 
GBN 500 53 54 1000
TLT 1000 53 53 3/4 1000
int symbol_get_type ( const char *  objname)

Return the type of a particular object.

Parameters
objnameName of the object
Return values
-1Object not found
otherThe object type
Note
This function is deprecated in favour of tf_symbol_get_type()
char** symbol_historic_field ( const char *  name,
int  fieldnum,
int *  number 
)

Get all data for a particular field number within a symbol.

Parameters
[in]nameThe symbol name
[in]fieldnumThe fieldnumber to return the values for
[out]numberNumber of fields returned
Returns
An array of values

The number of matching fields is placed into *number and an array of strings is returned.

This array of strings can then be deallocated by free_array()

The table below shows some sample type 3 data that may be cached for the object /LO/CAPLIN. In this case, the TradePrice, TradeTime and TradeVolume fields are all type 3 fields. If the TradePrice field number is 18, then if the Transformer module calls argv = symbol_historic_field("/LO/CAPLIN", 18, &argc), an array containing "53 3/4", "54 1/2", "54 1/4". "54" and "53 1/2" will be returned.

TradePrice TradeTime TradeVolume 
53 3/4 10:19 10000
54 1/2 10:19 600
54 1/4 10:18 1000
54 10:17 1233
53 1/2 10:17 67
char* symbol_last_field ( const char *  name,
int  fieldnum 
)

Return the last received fieldvalue for a symbol.

Parameters
nameSymbol name
fieldnumThe field number
Returns
The current value from the cache for the specified object and field names, or null if the value is not found. If null is returned, it could be because the object was not found in the cache, or because the object does not contain the specified field.

The return parameter should freed using the free() function after use

char* symbol_last_field_byname ( const char *  name,
const char *  field 
)

Return the last recieved fieldvalue for a symbol.

Parameters
nameSymbol name
fieldThe fieldname
Returns
The current value from the cache for the specified object and field names, or null if the value is not found. If null is returned, it could be because the object was not found in the cache, or because the object does not contain the specified field, or the field has not been defined using the "add-field" configuration option.

The return parameter should freed using the system free() function after use

ds_data_t* symbol_last_mmaker_update ( const char *  name,
const char *  mmaker 
)

Returns the currently cached Type 2 data for a symbol/Type 2 index.

Parameters
nameName of the symbol
mmakerThe type 2 index
Returns
A ds_data_t containing the current values for the requested type 2 index

The ds_data_t returned by this function should be freed using ds_free_data() after use.

The table below shows some sample type 2 data that may be cached for the object /LO/CAPLIN. In this case, the MarketMakerId field contains the type 2 indices. To get the data for the MarketMaker GBN, the Transformer module should call symbol_last_mmaker_update("/LO/CAPLIN", "GBN").

MarketMakerId BidSize Bid Ask AskSize 
BRC 1000 52 1/2 54 750
GBN 500 53 54 1000
TLT 1000 53 53 3/4 1000
ds_data_t* symbol_last_permission_update ( const char *  name,
const char *  key 
)

Returns the currently cached permission object data.

Parameters
nameName of the permission object
keyThe key index
Returns
A ds_data_t containing the current values for the requested key index

The ds_data_t returned by this function should be freed using ds_free_data() after use.

The table below shows some sample permission object data that may be cached for the object /LO/CAPLIN. In this case, the key field contains bid values for different tiers.

To get the data for the key LON, the Transformer module should call symbol_last_permission_update("/LO/CAPLIN", "LON").

Key  BidTier1  BidTier2  BidTier3
LON 1.01 1.05 1.1
NYC 1.1 1.15 1.2
SGP 1.2 1.25 1.3
ds_data_t* symbol_last_update ( const char *  name)

Returns the currently cached Type 1 data for a symbol.

Parameters
nameName of the symbol
Returns
If present a ds_data_t containing an image of the Type 1 cache

The ds_data_t returned by this function should be freed using ds_free_data() after use

time_t symbol_last_updatetime ( const char *  name)

Return the time that the last update was received for this symbol.

Parameters
nameName of the symbol
char** symbol_match ( const char *  name,
int *  number 
)

Return a list of symbols matching the specifier.

The array returned by this function should be freed using free_array()

Parameters
[in]name- The wildcard to match
[out]number- Number of matching symbols
Returns
A pointer to an array of symbol names

The number of matching symbols is placed into *number and an array of strings is returned.

This array of strings can then be deallocated by free_array()

Deprecated:
The use of filename-style wildcards is being deprecated throughout the Caplin platform in favour of standard regular expressions. Please see tf_symbol_match() for a regular expression compatible version of this function.
char** symbol_match_bytype ( const char *  name,
int  type,
int *  number 
)

Return a list of symbols matching the pattern and of the specified type.

The array returned by this function should be freed using free_array()

Parameters
[in]nameThe wildcard to match
[in]typeObject type to match
[out]numberNumber of matching symbols
Returns
A pointer to an array of symbol names

The number of matching symbols is placed into *number and an array of strings is returned.

This array of strings can then be deallocated by free_array()

Deprecated:
The use of filename-style wildcards is being deprecated throughout the Caplin platform in favour of standard regular expressions. Please see tf_symbol_match_bytype() for a regular expression compatible version of this function.
char** symbol_return_mmakers ( const char *  name,
int *  num 
)

Returns a list of all the cached Type 2 market makers.

Parameters
[in]nameName of the symbol
[out]numNumber of market makers for this symbol
Returns
Pointer to an array of market makers (NULL if none)

The return values of this function should be freed using free_array()

The table below shows some sample type 2 data that may be cached for the object /LO/CAPLIN. In this case, the MarketMakerId field contains the type 2 indices. If the Transformer module calls symbols_return_mmakers on /LO/CAPLIN, an array containing "BRC", "GBN" and "TLT" will be returned.

MarketMakerId BidSize Bid Ask AskSize 
BRC 1000 52 1/2 54 750
GBN 500 53 54 1000
TLT 1000 53 53 3/4 1000
char** symbol_return_permission_keys ( const char *  name,
int *  num 
)

Returns a list of all the cached permission object keys.

Parameters
[in]nameName of the symbol
[out]numNumber of keys for this symbol
Returns
Pointer to an array of keys (NULL if none)

The return values of this function should be freed using free_array()

The table below shows some sample permission object data that may be cached for the object /LO/CAPLIN.

If the Transformer module calls symbols_return_permission_keys on /LO/CAPLIN, an array containing "LON", "NYC" and "SGP" will be returned.

Key  BidTier1  BidTier2  BidTier3
LON 1.01 1.05 1.1
NYC 1.1 1.15 1.2
SGP 1.2 1.25 1.3
int tf_symbol_get_status ( const char *  name,
char **  status_message_ptr 
)

Return the status for an object within the cache.

Parameters
name- Name of the object to query
[out]status_message_ptr- Output for the status message (may be NULL). This should be deallocated with ds_free() by the caller
Return values
OBJ_STATUS_STALE
OBJ_STATUS_LIMITED
OBJ_STATUS_OK
int tf_symbol_get_type ( const char *  objname)

Return the type of a particular object.

Parameters
objnameName of the object
Return values
-1Object not found
otherThe object type
char** tf_symbol_match ( const char *  name,
int *  number 
)

Return a list of symbols matching the specifier.

The array returned by this function should be freed using free_array()

Parameters
[in]nameThe wildcard to match
[out]numberNumber of matching symbols
Returns
A pointer to an array of symbol names

The number of matching symbols is placed into *number and an array of strings is returned.

This array of strings can then be deallocated by free_array()

char** tf_symbol_match_bytype ( const char *  pattern,
int  type,
int *  number 
)

Return a list of symbols matching the pattern and of the specified type.

The array returned by this function should be freed using free_array()

Parameters
[in]pattern- The wildcard to match
[in]type- Object type to match
[out]number- Number of matching symbols
Returns
A pointer to an array of symbol names

The number of matching symbols is placed into *number and an array of strings is returned.

This array of strings can then be deallocated by free_array()

void tf_symbol_send_status ( const char *  name,
int  status,
const char *  message 
)

Send a status message for an object within the cache.

Parameters
name- Name of the object to send the cache for
status- Status flags to send
message- Status message to send

Status should be one of the following OBJ_STATUS_OK, OBJ_STATUS_INFO, OBJ_STATUS_STALE


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