Transformer SDK For C
8.0.3.342099-79b6f512
|
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_t * | symbol_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_t * | symbol_last_permission_update (const char *name, const char *key) |
Returns the currently cached permission object data. More... | |
ds_data_t * | symbol_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... | |
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
#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.
int symbol_create | ( | const char * | name, |
unsigned int | flags | ||
) |
Create a new symbol within the Transformer memory.
name | Symbol name |
flags | Flags to create the object with see FIXME |
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.
void symbol_delete_all_mmaker | ( | const char * | name | ) |
Delete all the Type 2 data associated with a symbol.
name | Name of the symbol |
void symbol_delete_all_permission_keys | ( | const char * | name | ) |
Delete all the data associated with a permission object.
name | Name of the symbol |
void symbol_delete_mmaker | ( | const char * | name, |
const char * | mmaker | ||
) |
Delete the data associated with a type 2 index.
name | Name of the symbol |
mmaker | The 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.
name | Name of the symbol |
key | The 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.
name | Name of the symbol |
index | The type 2 index |
fieldnum | The 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.
objname | Name of the object |
-1 | Object not found |
other | The object type |
char** symbol_historic_field | ( | const char * | name, |
int | fieldnum, | ||
int * | number | ||
) |
Get all data for a particular field number within a symbol.
[in] | name | The symbol name |
[in] | fieldnum | The fieldnumber to return the values for |
[out] | number | Number of fields returned |
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.
name | Symbol name |
fieldnum | The field number |
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.
name | Symbol name |
field | The fieldname |
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.
name | Name of the symbol |
mmaker | The 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.
name | Name of the permission object |
key | The 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.
name | Name of the symbol |
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.
name | Name 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()
[in] | name | - The wildcard to match |
[out] | number | - Number of matching symbols |
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** 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()
[in] | name | The wildcard to match |
[in] | type | Object type to match |
[out] | number | Number of matching symbols |
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** symbol_return_mmakers | ( | const char * | name, |
int * | num | ||
) |
Returns a list of all the cached Type 2 market makers.
[in] | name | Name of the symbol |
[out] | num | Number of market makers for this symbol |
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.
[in] | name | Name of the symbol |
[out] | num | Number of keys for this symbol |
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.
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 |
OBJ_STATUS_STALE | |
OBJ_STATUS_LIMITED | |
OBJ_STATUS_OK |
int tf_symbol_get_type | ( | const char * | objname | ) |
Return the type of a particular object.
objname | Name of the object |
-1 | Object not found |
other | The 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()
[in] | name | The wildcard to match |
[out] | number | Number of matching symbols |
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()
[in] | pattern | - The wildcard to match |
[in] | type | - Object type to match |
[out] | number | - Number of matching symbols |
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.
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