Apama Capital Markets Foundation  10.7.0.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
MDM_MarketDataInterface.h File Reference

Interface functions for the Market Data Manager. More...

#include <CHashMap.h>
#include <EventCodec.h>
#include <SM_SessionInterface.h>
#include <string>
#include <vector>
#include <list>
#include <set>

Go to the source code of this file.

Classes

struct  AP_MDM_AdapterInterface
 
struct  AP_MDM_Interface
 
class  SchemaItemValue
 
class  SchemaItem
 

Macros

#define MDM_DEFAULT_STRING   "~#"
 
#define MDM_DEFAULT_FLOAT   0.000001
 
#define MDM_DEFAULT_INT   -999999
 

Typedefs

typedef std::vector< std::string > StringList
 
typedef std::set< std::string > StringSet
 
typedef SchemaItem ExtraParam
 
typedef SchemaItemValue ExtraParamValue
 
typedef std::list< ExtraParamExtraParamList
 
typedef std::list
< ExtraParamValue
ExtraParamValueList
 
typedef SchemaItem NewsData
 
typedef std::list< NewsDataNewsDataList
 
typedef SchemaItemValue StringPair
 
typedef std::vector< StringPairStringDictionary
 

Enumerations

enum  AP_MDM_StreamType {
  MDM_UNKNOWN_STREAM = 0, MDM_BBA_STREAM = 1, MDM_TRADE_STREAM = 2, MDM_MBP_STREAM = 8,
  MDM_MBO_STREAM = 16, MDM_EP_STREAM = 32, MDM_QUOTEBOOK_STREAM = 64, MDM_NEWS_STREAM = 128
}
 
enum  AP_MDM_TransferMode { MDM_COMPOUND_DELTA = 1, MDM_SNAPSHOT_ONLY }
 
enum  AP_MDM_ErrorLevel { MDM_FATAL, MDM_ERROR, MDM_WARNING, MDM_INFO }
 

Functions

AP_MDM_API void AP_MDM_Init (AP_MDM_AdapterInterface *adapterInterface, void *transportInternals, AP_SESSION_Interface *sessionManagerInterface, AP_MDM_Interface **md)
 
AP_MDM_API void AP_MDM_DeInit (AP_MDM_Interface *md)
 
AP_MDM_API void AP_MDM_ConnectSuccess (AP_MDM_Interface *md, const char *subKey, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_ConnectFailed (AP_MDM_Interface *md, const char *subKey, const char *description, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_DisconnectSuccess (AP_MDM_Interface *md, const char *subKey, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_DisconnectFailed (AP_MDM_Interface *md, const char *subKey, const char *description, AP_TimestampSet *tss)
 
AP_MDM_API int AP_MDM_ProcessEvent (AP_MDM_Interface *md, AP_TransportEvent event, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_SetBBAData (AP_MDM_Interface *md, const char *subKey, AP_float64 bidPrice, AP_int64 bidQty, AP_float64 askPrice, AP_int64 askQty)
 
AP_MDM_API void AP_MDM_SetTradeData (AP_MDM_Interface *md, const char *subKey, AP_float64 price, AP_int64 quantity, const char *taker, const char *receiver, const char *currency)
 
AP_MDM_API void AP_MDM_SetBidDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId, AP_float64 price, AP_int64 quantity, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_SetAskDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId, AP_float64 price, AP_int64 quantity, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertBidDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId, AP_float64 price, AP_int64 quantity, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertAskDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId, AP_float64 price, AP_int64 quantity, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_DeleteBidDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId)
 
AP_MDM_API void AP_MDM_DeleteAskDepthData (AP_MDM_Interface *md, const char *subKey, const char *depthId)
 
AP_MDM_API const char * AP_MDM_GetBidDepthIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API const char * AP_MDM_GetAskDepthIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API void AP_MDM_SetBidOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId, AP_float64 price, AP_int64 quantity, const char *party, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_SetAskOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId, AP_float64 price, AP_int64 quantity, const char *party, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertBidOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId, AP_float64 price, AP_int64 quantity, const char *party, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertAskOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId, AP_float64 price, AP_int64 quantity, const char *party, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_DeleteBidOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId)
 
AP_MDM_API void AP_MDM_DeleteAskOrderBookData (AP_MDM_Interface *md, const char *subKey, const char *orderId)
 
AP_MDM_API const char * AP_MDM_GetBidOrderIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API const char * AP_MDM_GetAskOrderIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API void AP_MDM_SetBidQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity, AP_float64 price, const char *party, const char *requestId, const bool tradable, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_SetAskQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity, AP_float64 price, const char *party, const char *requestId, const bool tradable, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertBidQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity, AP_float64 price, const char *party, const char *requestId, const bool tradable, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_InsertAskQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity, AP_float64 price, const char *party, const char *requestId, const bool tradable, const StringDictionary &epValues)
 
AP_MDM_API void AP_MDM_DeleteBidQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity)
 
AP_MDM_API void AP_MDM_DeleteAskQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId, AP_int64 quantity)
 
AP_MDM_API void AP_MDM_DeleteMultipleBidQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId)
 
AP_MDM_API void AP_MDM_DeleteMultipleAskQuotebookData (AP_MDM_Interface *md, const char *subKey, const char *quoteId)
 
AP_MDM_API const char * AP_MDM_GetBidQuotebookIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API const char * AP_MDM_GetAskQuotebookIdAtLevel (AP_MDM_Interface *md, const char *subKey, AP_int64 level)
 
AP_MDM_API void AP_MDM_SetNewsData (AP_MDM_Interface *md, const char *subKey, const char *newsId, const StringSet &symbolSet, AP_int64 updateType, const char *headline, const char *story, const AP_float64 sourceTimestamp, const NewsDataList &newsDataList, const AP_float64 value=MDM_DEFAULT_FLOAT)
 
AP_MDM_API void AP_MDM_DeleteNewsData (AP_MDM_Interface *md, const char *subKey, const char *newsId, const StringSet &symbolSet, const AP_float64 sourceTimestamp, const NewsDataList &newsDataList)
 
AP_MDM_API void AP_MDM_DefineNewsSchema (AP_MDM_Interface *md, const char *subKey, const NewsDataList &newsDataList)
 
AP_MDM_API void AP_MDM_SetExtraParam (AP_MDM_Interface *md, const char *subKey, const char *paramName, const char *type, const char *value, const char *description)
 
AP_MDM_API void AP_MDM_SetExtraParams (AP_MDM_Interface *md, const std::string &subKey, const ExtraParamList &extraParamList)
 
AP_MDM_API void AP_MDM_SetExtraParamValue (AP_MDM_Interface *md, const char *subKey, const char *paramName, const char *value)
 
AP_MDM_API void AP_MDM_SetExtraParamsValue (AP_MDM_Interface *md, const std::string &subKey, const ExtraParamValueList &extraParamValueList)
 
AP_MDM_API void AP_MDM_RemoveExtraParam (AP_MDM_Interface *md, const char *subKey, const char *paramName, AP_bool permanent=false)
 
AP_MDM_API void AP_MDM_RemoveExtraParams (AP_MDM_Interface *md, const std::string &subKey, const StringList &paramNames, AP_bool permanent=false)
 
AP_MDM_API void AP_MDM_SequenceToString (const StringSet &stringSet, std::string &result)
 
AP_MDM_API void AP_MDM_DictionaryToString (const StringDictionary &stringDictionary, std::string &result)
 
AP_MDM_API void AP_MDM_EscapeString (const std::string &input, std::string &result)
 
AP_MDM_API void AP_MDM_ClearSubscriptionData (AP_MDM_Interface *md, const char *subKey)
 
AP_MDM_API void AP_MDM_ClearSourceData (AP_MDM_Interface *md, AP_int64 sourceId)
 
AP_MDM_API void AP_MDM_ClearData (AP_MDM_Interface *md)
 
AP_MDM_API void AP_MDM_SubscriptionCommit (AP_MDM_Interface *md, const char *subKey, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_SourceCommit (AP_MDM_Interface *md, AP_int64 sourceId, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_Commit (AP_MDM_Interface *md, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_RemoveSubscription (AP_MDM_Interface *md, const char *subKey)
 
AP_MDM_API void AP_MDM_RemoveSourceSubscriptions (AP_MDM_Interface *md, AP_int64 sourceId)
 
AP_MDM_API void AP_MDM_RemoveSubscriptions (AP_MDM_Interface *md)
 
AP_MDM_API void AP_MDM_Stop (AP_MDM_Interface *md)
 
AP_MDM_API void AP_MDM_Start (AP_MDM_Interface *md)
 
AP_MDM_API void AP_MDM_ReportError (AP_MDM_Interface *md, const char *subKey, const char *errMsg, AP_MDM_ErrorLevel severity, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_ReportSourceError (AP_MDM_Interface *md, AP_int64 sourceId, const char *errMsg, AP_MDM_ErrorLevel severity, AP_TimestampSet *tss)
 
AP_MDM_API void AP_MDM_SetDecoder (AP_MDM_Interface *md, AP_EventDecoder *decoder)
 
AP_MDM_API void AP_MDM_CreateDBEntry (AP_MDM_Interface *md, const char *subKey, AP_MDM_StreamType type)
 
AP_MDM_API void AP_MDM_DeleteDBEntry (AP_MDM_Interface *md, const char *subKey)
 
AP_MDM_API void AP_MDM_LogLatency (AP_MDM_Interface *md, IAF_TimestampConfig *config)
 

Detailed Description

Interface functions for the Market Data Manager.

Macro Definition Documentation

#define MDM_DEFAULT_FLOAT   0.000001

Default float value to be used in the data setters API

#define MDM_DEFAULT_INT   -999999

Default integer value to be used in the data setters API

#define MDM_DEFAULT_STRING   "~#"

Default string value to be used in the data setters API

Typedef Documentation

ExtraParam typedef from SchemaItem

typedef std::list<ExtraParam> ExtraParamList

A List of ExtraParam items

ExtraParamValue typedef from SchemaItemValue

A List of ExtraParamValue items

NewsData typedef from SchemaItem

typedef std::list<NewsData> NewsDataList

A List of NewsData items

typedef std::vector<StringPair> StringDictionary

A List of StringPair items

typedef std::vector<std::string> StringList

A List of strings

StringPair typedef from SchemaItemValue

typedef std::set<std::string> StringSet

A Set of strings

Enumeration Type Documentation

Error severity

Enumerator
MDM_FATAL 

Fatal level

MDM_ERROR 

Error level

MDM_WARNING 

Warning level

MDM_INFO 

Info level

Basic stream enum types supported

Enumerator
MDM_UNKNOWN_STREAM 

Unknown Stream type

MDM_BBA_STREAM 

Best Bid/Ask Stream type

MDM_TRADE_STREAM 

Trade Stream type

MDM_MBP_STREAM 

Depth (Market by Price) Stream type

MDM_MBO_STREAM 

Orderbook (Market by Order) Stream type

MDM_EP_STREAM 

Extra Params Stream type

MDM_QUOTEBOOK_STREAM 

Quotebook Stream type

MDM_NEWS_STREAM 

News Stream type

Data transfer modes

Enumerator
MDM_COMPOUND_DELTA 

Compound Delta mode

MDM_SNAPSHOT_ONLY 

Snapshot Only mode

Function Documentation

AP_MDM_API void AP_MDM_CreateDBEntry ( AP_MDM_Interface md,
const char *  subKey,
AP_MDM_StreamType  type 
)

Create a Database store for a Datastream type for a subscription key.

This is usually done internally and not explicitly by the adapter.

Parameters
mdThe AP_MDM_Interface to use.
subKeyThe subscription key to create the DB for.
typeThe datastream type of the database to create.
See also
AP_MDM_DeleteDBEntry
AP_MDM_API void AP_MDM_DeleteDBEntry ( AP_MDM_Interface md,
const char *  subKey 
)

Delete a Database store.

This is usually done internally and not explicitly by the adapter.

Parameters
mdThe AP_MDM_Interface to use.
subKeyThe subscription key to delete the DB.
See also
AP_MDM_CreateDBEntry
AP_MDM_API void AP_MDM_LogLatency ( AP_MDM_Interface md,
IAF_TimestampConfig *  config 
)

Set the latency logging configuration.

Parameters
mdThe AP_MDM_Interface to use.
configThe latency logging configuration.
AP_MDM_API int AP_MDM_ProcessEvent ( AP_MDM_Interface md,
AP_TransportEvent  event,
AP_TimestampSet *  tss 
)

Process an upstream event.

Used in the sendTransportEvent() function of the Transport.

Parameters
mdThe AP_MDM_Interface to use.
eventThe transport event to process.
tssThe timestamp set of the event.
AP_MDM_API void AP_MDM_ReportError ( AP_MDM_Interface md,
const char *  subKey,
const char *  errMsg,
AP_MDM_ErrorLevel  severity,
AP_TimestampSet *  tss 
)

Report a source error for a specific subscription key.

Parameters
mdThe AP_MDM_Interface to use.
subKeyThe subscription key the error is for.
errMsgThe description of the error.
severityThe severity of the error.
tssThe timestamp set of the event.
AP_MDM_API void AP_MDM_ReportSourceError ( AP_MDM_Interface md,
AP_int64  sourceId,
const char *  errMsg,
AP_MDM_ErrorLevel  severity,
AP_TimestampSet *  tss 
)

Report a source error.

Parameters
mdThe AP_MDM_Interface to use.
sourceIdThe source Id the error is for.
errMsgThe description of the error.
severityThe severity of the error.
tssThe timestamp set of the event.
AP_MDM_API void AP_MDM_SetDecoder ( AP_MDM_Interface md,
AP_EventDecoder *  decoder 
)

Set the event decoder.

Used in the addEventDecoder() function of the Transport.

Parameters
mdThe AP_MDM_Interface to use.
decoderThe event decoder.
AP_MDM_API void AP_MDM_Start ( AP_MDM_Interface md)

Start the Market Data interface. Used during start() in the transport.

Parameters
mdThe AP_MDM_Interface to use.
See also
AP_MDM_Stop
AP_MDM_API void AP_MDM_Stop ( AP_MDM_Interface md)

Stop the Market Data interface. Used during stop() in the transport.

Parameters
mdThe AP_MDM_Interface to use.
See also
AP_MDM_Start