Transformer SDK For C  6.2.11.309924
Transformer Module Implementation

Macros

#define CMD_MODULE_LOAD
 Load a module. More...
 
#define CMD_MODULE_UNLOAD
 Unload a module. More...
 

Functions

void mod_config_parse_file (const char *file)
 Parse a mandatory module configuration file. More...
 
void mod_config_parse_optional_file (const char *file)
 Parse an optional module configuration file. More...
 
TRANSFORMER_MODULE_EXPORT void mod_exit ()
 Module exit function. More...
 
TRANSFORMER_MODULE_EXPORT void mod_init (char *module_name)
 Module initialisation function. More...
 

Detailed Description

A module for Caplin Transformer takes the form of a dynamic library which is loaded on startup or on receipt of a user command.

Each module consists of a series of routines written in C. This document describes the functions available to the module programmer that can be used to provide the real-time market data and republish it to the DataSource API.

The implementation of a module can be split into the following stages:

Module Management

For modules to be loaded and unloaded correctly, they should implement the mod_init() and mod_exit() functions which are called on initialisation and exit respectively.

Module configuration

A Caplin Transformer module is configured by reading a configuration file at startup. Using a configuration file means aspects of the module's operation can be altered without the need for recompilation.

The Caplin Transformer SDK includes a configuration API which comprises functions that enable you to set configuration options specific to your application.

The configuration API gives you additional flexibility when programming your business module.

The configuration API makes use of "configuration contexts". A configuration context enables you to keep sets of configuration options independent of any others.

Note: Using the default configuration context is acceptable in most cases. The configuration API allows you to group your configuration options within a configuration context in two ways: either as a group or a section.

Requesting data

In order for Caplin Transformer to supply updated information to a module, the module has to add a listener to a particular set of symbols.

Transformer then makes an active request for the symbols from DataSource applications connected to the DataSource API, unless a requested symbol is already within the Caplin Transformer memory core (i.e. another module has requested it), in which case your module will receive the data without it being rerequesting from the data source.

Having requested data for a particular symbol, whenever any values associated with that symbol change, Caplin Transformer will receive a packet of information containing an array of values. Individual values can then be extracted and processed

Manipulating data

Once a module has received data it can manipulate the contents of the update that it as has received. The actual mathematical processing of the data must be accomplished using standard programming techniques, however the Transformer provides functions to manipulate the update packet.

Publishing data

Once processing is performed it is often necessary to publish the manipulated data. Data may be published to all connected DataSource peers or it may be held in the Transformer's cache pending a request from a peer.

Macro Definition Documentation

#define CMD_MODULE_LOAD

Load a module.

This message may be sent to make the Transformer load a module. If the module is already loaded then it will be reloaded and reinitialised. To avoid resource leaks, the mod_exit() entry point of the module should be correctly implemented.

#define CMD_MODULE_UNLOAD

Unload a module.

This message may be sent to make the Transformer unload a module. To avoid resource leaks, the mod_exit() entry point of the module should be correctly implemented.

Function Documentation

void mod_config_parse_file ( const char *  file)

Parse a mandatory module configuration file.

Called by modules to parse their configuration file

Parameters
fileFilename (without path) of the configuration file
void mod_config_parse_optional_file ( const char *  file)

Parse an optional module configuration file.

Called by modules to parse their configuration file

Parameters
fileFilename (without path) of the configuration file
TRANSFORMER_MODULE_EXPORT void mod_exit ( )

Module exit function.

This function is called when a module is removed from the system. In order to avoid resource leaks, it should be implemented and deregister interests, providers, userdata as well as deallocate any memory.

Examples:
demo-calcvalue.c, demo-delete.c, demo-modify.c, demo-spread.c, demo-userdata.c, and demo-userdata2.c.
TRANSFORMER_MODULE_EXPORT void mod_init ( char *  module_name)

Module initialisation function.

Parameters
module_name- Name of the module

All standard modules should implement this function. This is standard entry point and allows a module to parse configuration files and register any initial interest or provider callbacks.

A module can be loaded many times under different names. The name allows each instance of the module to use a different configuration file if necessary.


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