-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathILinkCBIF.hpp
304 lines (271 loc) · 9.17 KB
/
ILinkCBIF.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/*
THIS SOFTWARE IS OPEN SOURCE UNDER THE MIT LICENSE
Copyright 2022 Vincent Maciejewski, Quant Enterprises & M2 Tech
Contact:
https://www.linkedin.com/in/vmayeski/
http://m2te.ch/
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
https://opensource.org/licenses/MIT
*/
#pragma once
#include <stdint.h>
#include "ilink_v8/FTI.h"
namespace m2::ilink
{
/**
* @brief Callback Interface for ILink
*
* Member functions must be implemented for each message.
* These are called from process_message_from_msgw().
*
*/
struct CBIF
{
//
// SESSION LAYER
//
virtual void sequence(
uint32_t NextSeqNo,
sbe::FTI::Value FaultToleranceIndicator,
sbe::KeepAliveLapsed::Value KeepAliveLapsed
) = 0;
/**
* @brief negotiationResponse
* @@see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Negotiation+Response
*
*/
virtual void negotiationResponse(
uint64_t RequestTimeStamp,
uint64_t UUID,
sbe::FTI::Value FTI,
uint32_t PreviousSeqNo,
uint64_t PreviousUUID) = 0;
/**
* @brief negotiationReject
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Negotiation+Reject
*
*/
virtual void negotiationReject(
uint64_t RequestTimeStamp,
uint64_t UUID,
sbe::FTI::Value FTI,
uint16_t errorCodes,
const std::string &Reason) = 0;
/**
* @brief establishementAck
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Establishment+Acknowledgment
*
*/
virtual void establishementAck(
uint64_t RequestTimeStamp,
uint64_t UUID,
sbe::FTI::Value FTI,
uint32_t PreviousSeqNo,
uint64_t PreviousUUID,
uint32_t NextSeqNo,
uint16_t KeepAliveInterval) = 0;
/**
* @brief establishmentReject
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Establishment+Reject
*
*/
virtual void establishmentReject(
uint64_t RequestTimeStamp,
uint64_t UUID,
sbe::FTI::Value FTI,
uint32_t NextSeqNo,
uint16_t errorCodes,
const std::string &Reason) = 0;
/**
* @brief not applied
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Not+Applied
*
* @param UUID
* @param FromSeqNo
* @param MsgCount
*/
virtual void notApplied(
uint64_t UUID,
uint32_t FromSeqNo,
uint32_t MsgCount) = 0;
/**
* @brief Retransmission Request
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Retransmission
*
*/
virtual void retransmission(
uint64_t UUID,
uint64_t RequestTimestamp,
uint64_t LastUUID,
uint32_t FromSeqNo,
uint32_t MsgCount) = 0;
/**
* @brief Retransmission reject
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Retransmit+Reject
*
*/
virtual void
retransmitReject(
uint64_t UUID,
uint64_t LastUUID,
uint64_t RequestTimestamp,
uint16_t ErrorCodes,
const std::string &Reason) = 0;
//
// APPLICATION LAYER
//
/**
* @brief businessReject
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Business+Reject
*
*/
virtual void businessReject(
uint64_t UUID,
uint32_t SeqNum,
const std::string &Text,
uint64_t SendingTime,
uint16_t BusinessRejectRefID,
uint32_t RefSeqNum,
uint16_t TagId,
uint16_t BusinessRejectReason,
const std::string &RefMsgType,
bool PossRetransFlag) = 0;
struct exec_report_param_t
{
uint16_t templateId;
uint64_t UUID;
uint32_t SeqNum;
std::string ExecID;
std::string SenderID;
std::string ClOrdID;
uint64_t PartyDetailsListReqID;
uint64_t OrderID;
int64_t Price_mantissa;
int8_t Price_exponent;
int64_t StopPx_mantissa;
int8_t StopPx_exponent;
uint64_t lastPx_mantissa;
int8_t lastPx_exponent;
uint64_t TransactTime;
uint64_t SendingTime;
uint64_t OrderRequestID;
std::string Location;
int32_t SecurityID;
uint32_t OrderQty;
uint32_t DispQty;
uint32_t LastQty;
uint32_t LeavesQty;
uint32_t CumQty;
sbe::OrderType::Value OrdType;
sbe::SideReq::Value Side;
sbe::TimeInForce::Value TimeInForce;
sbe::ManualOrdIndReq::Value ManualOrderIndicator;
bool PossRetransFlag;
std::string OrdStatus;
// for trades
uint64_t SideTradeID;
std::string ExecType;
std::string TradeID;
// for spreads
u_int64_t SecExecID;
bool AggressorIndicator;
// for addendum
uint64_t OrigSideTradeID;
};
/**
* @brief execution report for
* New
* Modify
* Cancel
* Status
* Elimination
* TradeOutright
* TradeSpread
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/From+CME+Globex+to+Client+System
*/
virtual void executionReport(
const exec_report_param_t ¶m) = 0;
struct canc_rej_param_t
{
uint16_t templateId;
uint64_t UUID;
uint32_t SeqNum;
std::string ExecID;
std::string SenderID;
std::string ClOrdID;
uint64_t PartyDetailsListReqID;
uint64_t OrderID;
uint64_t TransactTime;
uint64_t SendingTime;
uint64_t OrderRequestID;
std::string Location;
sbe::ManualOrdIndReq::Value ManualOrderIndicator;
bool PossRetransFlag;
std::string OrdStatus;
uint32_t CxlRejReason;
std::string CxlRejResponseTo;
};
/**
* @brief cancel reject for
* OrderCancelRejec
* OrderCancelReplaceReject
* @see @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/From+CME+Globex+to+Client+System
*/
virtual void cancelReject(
const canc_rej_param_t ¶m) = 0;
/**
* @brief partyDetailAck
*
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Party+Details+Definition+Request+Acknowledgment
*/
virtual void partyDetailAck(
uint64_t UUID,
uint32_t SeqNum,
uint64_t PartyDetailsListReqID,
uint64_t SendingTime,
uint8_t PartyRequestStatus,
bool PossRetransFlag,
const std::vector<std::string> &partyDetailID,
const std::vector<std::string> &partyDetailSource,
const std::vector<sbe::PartyDetailRole::Value> &partyDetailRole) = 0;
/**
* @brief partyDetailReport
*
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Party+Details+List+Report
*/
virtual void partyDetailReport(
uint64_t UUID,
uint32_t SeqNum,
uint64_t PartyDetailsListReqID,
uint64_t SendingTime,
const std::vector<std::string> &partyDetailID,
const std::vector<std::string> &partyDetailSource) = 0;
/**
* @brief terminate
* @see https://www.cmegroup.com/confluence/display/EPICSANDBOX/Terminate
*/
virtual void terminate(
uint64_t UUID,
uint16_t ErrorCodes,
const std::string &Reason) = 0;
};
}