9 #ifndef _SAG_MDM_INTERFACE_H_
10 #define _SAG_MDM_INTERFACE_H_
26 #include "sag_connectivity_plugins.hpp"
32 #if defined(_APBUILD_WIN32_ALL__) || defined(__WIN32__) || defined(WIN32)
40 #ifndef _APBUILD_WIN32_ALL__
41 #define _APBUILD_WIN32_ALL__
44 #ifdef SAG_MDM_BACKEND
45 #define SAG_MDM_API __declspec(dllexport)
46 #define SAG_MDM_CALL __stdcall
48 #define SAG_MDM_API __declspec(dllimport)
49 #define SAG_MDM_CALL __stdcall
52 #elif defined(_APBUILD_UNIX_ALL__) || defined(__unix__)
56 #error "Can't determine platform: try #define _APBUILD_WIN32_ALL__ or _APBUILD_UNIX_ALL__"
60 namespace softwareag {
61 namespace marketdata {
63 #define STREAMTYPE_BBA ("com.apama.md.BBA")
64 #define STREAMTYPE_TRADE ("com.apama.md.T")
65 #define STREAMTYPE_MBP ("com.apama.md.D")
66 #define STREAMTYPE_MBO ("com.apama.md.O")
67 #define STREAMTYPE_EP ("com.apama.md.EP")
68 #define STREAMTYPE_QUOTEBOOK ("com.apama.md.QB")
69 #define STREAMTYPE_NEWS ("com.apama.md.N")
86 #define MDM_DEFAULT_STRING "~#"
87 #define MDM_DEFAULT_FLOAT 0.000001
88 #define MDM_DEFAULT_INT -999999
118 SchemaItemValue(
const std::string ¶mName,
const std::string &value) : paramName_(paramName), value_(value) {}
139 SchemaItem(
const std::string ¶mName,
const std::string &type,
const std::string &value,
const std::string &description)
142 , description_(description)
170 : recordUpstream(false)
171 , recordDownstream(false)
173 , logDownstream(false)
174 , logRoundtrip(false)
181 class MarketDataSession;
182 typedef int64_t TimestampSetIndex;
183 typedef double TimestampSetTime;
187 typedef std::shared_ptr<TimestampSet> TimestampSetPtr;
216 virtual const char* getKey(
const std::string& symbol, int64_t sourceId,
AP_MDM_StreamType streamType, map_t& ctrlParams) = 0;
230 virtual void connect(
const std::string& subKey,
AP_MDM_StreamType streamType, map_t& ctrlParams) = 0;
244 virtual void disconnect(
const std::string& subKey,
AP_MDM_StreamType streamType, map_t& ctrlParams) = 0;
254 virtual void setMarketDataSession(MarketDataSession* mdSession) = 0;
277 virtual void Start() = 0;
282 virtual void Stop() = 0;
289 virtual bool ProcessMessage(Message& msgObj) = 0;
302 virtual void setHostSide(HostSide* hostSide);
354 virtual void setConnectSuccess(
const std::string& subKey, TimestampSetPtr tss) = 0;
364 virtual void setConnectFailed(
const std::string& subKey,
const std::string& description, TimestampSetPtr tss) = 0;
373 virtual void setDisconnectSuccess(
const std::string& subKey, TimestampSetPtr tss) = 0;
383 virtual void setDisconnectFailed(
const std::string& subKey,
const std::string & description, TimestampSetPtr tss) = 0;
392 virtual void SubscriptionCommit(
const std::string& subKey, TimestampSetPtr tss) = 0;
399 virtual void RemoveSubscription(
const std::string& subKey) = 0;
406 virtual void RemoveSourceSubscriptions(int64_t sourceId) = 0;
411 virtual void RemoveSubscriptions() = 0;
421 virtual void ClearSubscriptionData(
const std::string& subKey) = 0;
432 virtual void ClearSourceData(int64_t sourceId) = 0;
438 virtual void ClearData() = 0;
462 void addNow(TimestampSetIndex index);
470 void addTime(TimestampSetIndex index, TimestampSetTime time);
478 TimestampSetTime findTime(TimestampSetIndex index);
490 TimestampSetTime getRelativeTime();
Definition: Connectivity_MDInterfaces.h:448
std::vector< StringPair > StringDictionary
Definition: MDM_MarketDataInterface.h:231
HostSide * hostSide_
Definition: Connectivity_MDInterfaces.h:316
TimestampSet()
Definition: Connectivity_MDInterfaces.h:454
Definition: MDM_MarketDataInterface.h:63
Definition: MDM_MarketDataInterface.h:90
SchemaItemValue StringPair
Definition: MDM_MarketDataInterface.h:230
AP_MDM_ErrorLevel
Definition: MDM_MarketDataInterface.h:86
Definition: Connectivity_MDPublisher.h:22
bool logDownstream
Definition: Connectivity_MDInterfaces.h:165
Definition: MDM_MarketDataInterface.h:68
Definition: MDM_MarketDataInterface.h:88
std::string type_
Definition: Connectivity_MDInterfaces.h:145
SchemaItem NewsData
Definition: MDM_MarketDataInterface.h:227
Definition: Connectivity_MDInterfaces.h:59
bool logRoundtrip
Definition: Connectivity_MDInterfaces.h:166
bool recordDownstream
Definition: Connectivity_MDInterfaces.h:163
AP_MDM_StreamType
Definition: MDM_MarketDataInterface.h:62
std::list< NewsData > NewsDataList
Definition: MDM_MarketDataInterface.h:228
std::set< std::string > StringSet
Definition: MDM_MarketDataInterface.h:181
Logger * logger_
Definition: Connectivity_MDInterfaces.h:318
SchemaItemValue ExtraParamValue
Definition: MDM_MarketDataInterface.h:223
Definition: MDM_MarketDataInterface.h:70
Definition: MDM_MarketDataInterface.h:64
SchemaItemValue(const std::string ¶mName, const std::string &value)
Definition: Connectivity_MDInterfaces.h:118
std::string paramName_
Definition: Connectivity_MDInterfaces.h:125
SchemaItem ExtraParam
Definition: MDM_MarketDataInterface.h:222
MDMInterface * mdInterface_
Definition: Connectivity_MDInterfaces.h:320
Definition: Connectivity_MDInterfaces.h:342
std::string description_
Definition: Connectivity_MDInterfaces.h:146
SchemaItem(const std::string ¶mName, const std::string &type, const std::string &value, const std::string &description)
Definition: Connectivity_MDInterfaces.h:139
MDMInterface()
Definition: Connectivity_MDInterfaces.h:197
Definition: MDM_MarketDataInterface.h:67
Definition: Connectivity_MDInterfaces.h:161
std::vector< std::string > StringList
Definition: MDM_MarketDataInterface.h:180
Definition: MDM_MarketDataInterface.h:80
AP_MDM_TransferMode
Definition: MDM_MarketDataInterface.h:79
bool operator==(const SchemaItemValue &rhs) const
Definition: Connectivity_MDInterfaces.h:123
Definition: Connectivity_MDInterfaces.h:190
bool logUpstream
Definition: Connectivity_MDInterfaces.h:164
map_t & getTimeStamp()
Definition: Connectivity_MDInterfaces.h:484
Definition: MDM_MarketDataInterface.h:65
Definition: Connectivity_MDInterfaces.h:130
Definition: MDM_MarketDataInterface.h:66
Definition: Connectivity_MDInterfaces.h:259
Definition: Connectivity_MDInterfaces.h:327
Definition: MDM_MarketDataInterface.h:87
Definition: Connectivity_MDInterfaces.h:111
Definition: MDM_MarketDataInterface.h:89
std::string value_
Definition: Connectivity_MDInterfaces.h:126
std::list< ExtraParamValue > ExtraParamValueList
Definition: MDM_MarketDataInterface.h:225
Definition: MDM_MarketDataInterface.h:81
Definition: MDM_MarketDataInterface.h:69
bool recordUpstream
Definition: Connectivity_MDInterfaces.h:162
std::list< ExtraParam > ExtraParamList
Definition: MDM_MarketDataInterface.h:224