Calling the API

From Flametree Technologies
Revision as of 07:20, 27 June 2015 by Fiasys (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

This page describes how to call the Flametree attribution engine from within another application, using the Appllication Programming Interface (API).

The Flametree API is a collection of function calls and related constants that allow the FIA attribution engine to be called from within another program, rather than as a stand-alone application.

The library is written in C++ and is compiled into a 64-bit DLL (Dynamic Link Library). Wrapper files are alsp available that allow the engine to be called from other languages, including as C#, Python and Java.

The API was substantially redesigned in 2015 to use a data–driven interface (also known as a message-passing, or event-based API). Instead of using a large collection of method calls, the API depends on a much smaller number of calls and a data dictionary of arguments. The advantages of using a data-driven API for the Flametree engine are that

Data structures

In addition to the usual types of parameter such as integer and boolean-valued switches, FIA uses vector and matrix types to pass data to and from the host program.

A vector type is defined as

typedef vector <string> VECTOR_MATRIX;

A matrix type is defined as

typedef vector <vector<string> > STRING_MATRIX;

Please refer to the appropriate language section to see how to instantiate and use these data structures in non-C++ environments.


Functions

The following functions are available to the user:

int FIA_set_integer ( const int parameter_ID, const int value )
int FIA_set_long ( const int parameter_ID, const long value ) 
int FIA_set_double ( const int parameter_ID, const double value )
int FIA_set_bool ( const int parameter_ID, const bool value )
int FIA_set_string ( const int parameter_ID, string value )
int FIA_set_vector_string ( const int parameter_ID, VECTOR_MATRIX value )
int FIA_set_matrix ( const int parameter_ID, STRING_MATRIX value )
STRING_MATRIX FIA_get_matrix ( const int parameter_ID )
int FIA_run ( void )

Symbolic constants for data structures

Name Description Value
FT_MATRIX_PORTFOLIO Portfolio data 0
FT_MATRIX_BENCHMARK Benchmark data 1
FT_MATRIX_SECURITY Security master data 2
FT_MATRIX_YIELDCURVE Yield curve data 3
FT_MATRIX_STRESS Stress scenario data 4
FT_MATRIX_MAP Security mapping data 5
FT_MATRIX_FX FX data 6
FT_MATRIX_CPI CPI and index data 7
FT_MATRIX_RESULTS Results data 8
FT_MATRIX_DIAGNOSTIC Diagnostics data 9
FT_STRING_CARRY_DECOMPOSITION Carry settings 100
FT_STRING_CARRY_ALLOCATION_SECTORS Carry allocation settings 101
Personal tools
Namespaces
Variants
Actions
Manual
Attribution methodology
Data
Configuration
Running FIA
Reporting
Tutorials
Additional information
Company
Downloads
Toolbox