1 #ifndef libjmmcg_isimud_exchanges_MIT_JSE_messages_hpp
2 #define libjmmcg_isimud_exchanges_MIT_JSE_messages_hpp
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "config.h"
25 #include "reject_codes.hpp"
26
27 #include "../common/messages.hpp"
28 #include "../common/ref_data.hpp"
29
30 #include "core/max_min.hpp"
31
32 #include <boost/mpl/assert.hpp>
33 #include <boost/mpl/deref.hpp>
34 #include <boost/mpl/max_element.hpp>
35 #include <boost/mpl/min_element.hpp>
36 #include <boost/mpl/placeholders.hpp>
37 #include <boost/mpl/sizeof.hpp>
38 #include <boost/mpl/transform_view.hpp>
39 #include <boost/mpl/vector.hpp>
40 #include <boost/variant/variant.hpp>
41
42 #include <iostream>
43
44 namespace isimud { namespace exchanges { namespace MIT {
45
46
47
48
49 namespace JSE {
50
51 using CompID_t=std::array<char, 6>;
52 using ExecutionID_t=std::array<char, 21>;
53 using ExpireDateTime_t=std::array<char, 17>;
54 using Password_t=std::array<char, 10>;
55 using PasswordExpiry_t=std::int32_t;
56 using TraderMnemonic_t=std::array<char, 17>;
57 using Segment_t=std::array<char, 6>;
58
59 struct logon_args_t {
60 using UserName_t=CompID_t;
61 using Password_t=JSE::Password_t;
62
63 const CompID_t username{{}};
64 const Password_t password{{}};
65 const Password_t new_password{{}};
66 };
67
68
69
70
71 struct TransmissionComplete : public common::Header {
72 using Header_t=common::Header;
73 enum : common::MsgType_t {
74 type_const=static_cast<common::MsgType_t>(common::AdminMsgType::MissedMessageReport)
75 };
76 enum : std::size_t {
77 header_t_size=sizeof(Header_t)
78 };
79
80 const common::Status status;
81
82 explicit constexpr TransmissionComplete(const common::Status s) noexcept(true) FORCE_INLINE;
83
84
85
86
87
88
89
90 template<class SrcMsg> explicit __stdcall
91 TransmissionComplete(SrcMsg const &msg) noexcept(true)=delete FORCE_INLINE;
92 } __attribute__((packed));
93
94
95
96
97
98 struct Logon : public common::Header {
99 using Header_t=common::Header;
100 using logon_args_t=JSE::logon_args_t;
101
102 enum : common::MsgType_t {
103 type_const=static_cast<common::MsgType_t>(common::AdminMsgType::LogonRequest)
104 };
105 enum : std::size_t {
106 header_t_size=sizeof(Header_t)
107 };
108
109 const logon_args_t::UserName_t userName;
110 const logon_args_t::Password_t password;
111 const logon_args_t::Password_t newPassword;
112 static constexpr const std::uint8_t messageVersion=1;
113
114 constexpr Logon(const logon_args_t::UserName_t &UN, const logon_args_t::Password_t &P, const logon_args_t::Password_t &NP) noexcept(true) FORCE_INLINE;
115 explicit constexpr Logon(logon_args_t const &a) noexcept(true) FORCE_INLINE;
116
117
118
119
120
121
122
123 template<class SrcMsg> explicit __stdcall
124 Logon(SrcMsg const &msg) noexcept(true)=delete FORCE_INLINE;
125 } __attribute__((packed));
126
127
128
129
130 struct LogonResponse : public common::Header {
131 using Header_t=common::Header;
132 using RejectCode_t=mit_jse::reject_codes_enum;
133 using RejectCodes_t=std::underlying_type<RejectCode_t>::type;
134 enum : common::MsgType_t {
135 type_const=static_cast<common::MsgType_t>(common::AdminMsgType::LogonReply)
136 };
137 enum : std::size_t {
138 header_t_size=sizeof(Header_t)
139 };
140
141 struct respond;
142
143 static constexpr const RejectCode_t logon_success=mit_jse::reject_codes_enum::tag_SUCCESS;
144 static constexpr const RejectCode_t invalid_logon_details=mit_jse::reject_codes_enum::Native_Trading_Gateway_Invalid_User_ID_or_password_1;
145 static constexpr const RejectCode_t unknown_user=mit_jse::reject_codes_enum::Native_Trading_Gateway_Invalid_User_ID_or_password_1;
146
147 RejectCode_t rejectCode_;
148 PasswordExpiry_t passwordExpiry;
149
150 LogonResponse() noexcept(true) FORCE_INLINE;
151
152 RejectCode_t rejectCode() const noexcept(true) FORCE_INLINE {
153 return rejectCode_;
154 }
155 void rejectCode(RejectCode_t const &rc) noexcept(true) FORCE_INLINE {
156 rejectCode_=rc;
157 }
158 } __attribute__((packed));
159
160
161
162
163 struct NewOrder : public common::Header {
164 using Header_t=common::Header;
165 enum : common::MsgType_t {
166 type_const=static_cast<common::MsgType_t>(common::ClientMsgType::NewOrder)
167 };
168 enum : std::size_t {
169 header_t_size=sizeof(Header_t)
170 };
171 using order_qty_t=std::int32_t;
172 using ref_data_t=common::ref_data_t;
173
174 common::ClientOrderID_t clientOrderID_;
175 common::SecurityID_t instrumentID_;
176 TraderMnemonic_t traderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
177 common::Account_t account{"\0\0\0\0\0\0\0\0\0"};
178 common::OrderType orderType_;
179 common::TIF tif_;
180 ExpireDateTime_t expireDateTime{};
181 common::Side side_;
182 order_qty_t orderQty_;
183 order_qty_t displayQty{};
184 order_qty_t minimumQty{};
185 common::Price_t limitPrice_;
186 common::Price_t stoppedPrice=0;
187 common::Capacity capacity=common::Capacity::Principal;
188 const common::AutoCancel cancelOnDisconnect=common::AutoCancel::Cancel;
189 const common::OrderBook orderBook=common::OrderBook::Regular;
190 common::ExecutionInstruction executionInstruction=common::ExecutionInstruction::DoNotExcludeHiddenOrders;
191 common::OrderSubType orderSubType=common::OrderSubType::Order;
192
193 constexpr __stdcall NewOrder(common::ClientOrderID_t const &clID, common::OrderType const oT, common::TIF const t, common::Side const s, common::SecurityID_t instID, order_qty_t ordQty, common::Price_t p) noexcept(true) FORCE_INLINE;
194
195
196
197
198
199
200
201 template<class SrcMsg> __stdcall
202 NewOrder(SrcMsg const &msg, ref_data_t rd) noexcept(true) FORCE_INLINE;
203
204 common::SecurityID_t instrumentID() const noexcept(true) {
205 return instrumentID_;
206 }
207 void instrumentID(common::SecurityID_t i) noexcept(true) {
208 instrumentID_=i;
209 }
210
211 order_qty_t orderQty() const noexcept(true) {
212 return orderQty_;
213 }
214 void orderQty(order_qty_t i) noexcept(true) {
215 orderQty_=i;
216 }
217
218 common::OrderType orderType() const noexcept(true) {
219 return orderType_;
220 }
221 void orderType(common::OrderType i) noexcept(true) {
222 orderType_=i;
223 }
224
225 common::Side side() const noexcept(true) {
226 return side_;
227 }
228 void side(common::Side i) noexcept(true) {
229 side_=i;
230 }
231
232 common::ClientOrderID_t const &clientOrderID() const noexcept(true) {
233 return clientOrderID_;
234 }
235 void clientOrderID(common::ClientOrderID_t const &clID) noexcept(true) {
236 jmmcg::memcpy_opt(clID, clientOrderID_);
237 }
238
239 common::Price_t limitPrice() const noexcept(true) {
240 return limitPrice_;
241 }
242 void limitPrice(common::Price_t p) noexcept(true) {
243 limitPrice_=p;
244 }
245
246 common::TIF tif() const noexcept(true) {
247 return tif_;
248 }
249 void tif(common::TIF t) noexcept(true) {
250 tif_=t;
251 }
252 } __attribute__((packed));
253
254
255
256
257 struct OrderCancelRequestSpecific1 {
258 common::SecurityID_t instrumentID_;
259 TraderMnemonic_t traderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
260
261 explicit constexpr OrderCancelRequestSpecific1(common::SecurityID_t instID) noexcept(true) FORCE_INLINE
262 : instrumentID_(instID) {
263 }
264 common::SecurityID_t instrumentID() const noexcept(true) {
265 return instrumentID_;
266 }
267 void instrumentID(common::SecurityID_t i) noexcept(true) {
268 instrumentID_=i;
269 }
270 } __attribute__((packed));
271
272
273
274
275 struct OrderMassCancelRequestSpecific1 {
276 common::SecurityID_t instrumentID_;
277 Segment_t segment;
278
279 explicit constexpr OrderMassCancelRequestSpecific1(common::SecurityID_t instID) noexcept(true) FORCE_INLINE
280 : instrumentID_(instID), segment{} {
281 }
282 common::SecurityID_t instrumentID() const noexcept(true) {
283 return instrumentID_;
284 }
285 void instrumentID(common::SecurityID_t i) noexcept(true) {
286 instrumentID_=i;
287 }
288 } __attribute__((packed));
289 struct OrderMassCancelRequestSpecific2 {
290 common::TargetBook targetBook=common::TargetBook::DarkMidpointOrderBook;
291 } __attribute__((packed));
292
293
294
295 struct OrderCancelReplaceRequest : public common::Header {
296 using Header_t=common::Header;
297 enum : common::MsgType_t {
298 type_const=static_cast<common::MsgType_t>(common::ClientMsgType::OrderCancelReplaceRequest)
299 };
300 enum : std::size_t {
301 header_t_size=sizeof(Header_t)
302 };
303 using order_qty_t=std::int32_t;
304 using ref_data_t=common::ref_data_t;
305
306 common::ClientOrderID_t clientOrderID_;
307 common::ClientOrderID_t originalClientOrderID_;
308 common::OrderID_t orderID{};
309 common::SecurityID_t instrumentID_;
310 TraderMnemonic_t traderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
311 common::Account_t account{"\0\0\0\0\0\0\0\0\0"};
312 common::OrderType orderType_{};
313 common::TIF tif_;
314 ExpireDateTime_t expireDateTime{};
315 common::Side side_;
316 order_qty_t orderQty_;
317 order_qty_t displayQty{};
318 order_qty_t minimumQty{};
319 common::Price_t limitPrice_;
320 common::Price_t stoppedPrice=0;
321 const common::OrderBook orderBook=common::OrderBook::Regular;
322
323 OrderCancelReplaceRequest(common::ClientOrderID_t const &clID, common::ClientOrderID_t const &origclID, common::SecurityID_t instID, order_qty_t ordQty, common::Price_t const p, common::TIF t, common::Side s) noexcept(true) FORCE_INLINE;
324
325
326
327
328
329
330
331 template<class SrcMsg> __stdcall
332 OrderCancelReplaceRequest(SrcMsg const &msg, ref_data_t rd) noexcept(true) FORCE_INLINE;
333
334 common::SecurityID_t instrumentID() const noexcept(true) {
335 return instrumentID_;
336 }
337 void instrumentID(common::SecurityID_t i) noexcept(true) {
338 instrumentID_=i;
339 }
340
341 common::ClientOrderID_t const &clientOrderID() const noexcept(true) {
342 return clientOrderID_;
343 }
344 void clientOrderID(common::ClientOrderID_t const &clID) noexcept(true) {
345 jmmcg::memcpy_opt(clID, clientOrderID_);
346 }
347
348 common::ClientOrderID_t const &originalClientOrderID() const noexcept(true) {
349 return originalClientOrderID_;
350 }
351 void originalClientOrderID(common::ClientOrderID_t const &clID) noexcept(true) {
352 jmmcg::memcpy_opt(clID, originalClientOrderID_);
353 }
354
355 common::Price_t limitPrice() const noexcept(true) {
356 return limitPrice_;
357 }
358 void limitPrice(common::Price_t p) noexcept(true) {
359 limitPrice_=p;
360 }
361
362 order_qty_t orderQty() const noexcept(true) {
363 return orderQty_;
364 }
365 void orderQty(order_qty_t i) noexcept(true) {
366 orderQty_=i;
367 }
368
369 common::Side side() const noexcept(true) {
370 return side_;
371 }
372 void side(common::Side i) noexcept(true) {
373 side_=i;
374 }
375
376 common::TIF tif() const noexcept(true) {
377 return tif_;
378 }
379 void tif(common::TIF t) noexcept(true) {
380 tif_=t;
381 }
382 } __attribute__((packed));
383
384
385
386
387 struct NewOrderCross : public common::Header {
388 using Header_t=common::Header;
389 enum : common::MsgType_t {
390 type_const=static_cast<common::MsgType_t>(common::ClientMsgType::NewOrderCrossMessage)
391 };
392 enum : std::size_t {
393 header_t_size=sizeof(Header_t)
394 };
395 using order_qty_t=std::int32_t;
396
397 common::CrossID_t crossID{};
398 const common::CrossType crossType=common::CrossType::InternalCross;
399 common::ClientOrderID_t buySideClientOrderID;
400 common::Capacity buySideCapacity{};
401 TraderMnemonic_t buySideTraderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
402 common::Account_t buySideccount{"\0\0\0\0\0\0\0\0\0"};
403 common::ClientOrderID_t sellSideClientOrderID{};
404 common::Capacity sellSideCapacity{};
405 TraderMnemonic_t sellSideTraderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
406 common::Account_t sellSideAccount{"\0\0\0\0\0\0\0\0\0"};
407 common::SecurityID_t instrumentID_;
408 common::OrderType orderType_{};
409 common::TIF tif_;
410 common::Price_t limitPrice_;
411 order_qty_t orderQty_;
412
413 constexpr NewOrderCross(common::ClientOrderID_t const &origclID, common::SecurityID_t instID, order_qty_t ordQty, common::Price_t const p, common::TIF t) noexcept(true) FORCE_INLINE;
414
415 common::SecurityID_t instrumentID() const noexcept(true) {
416 return instrumentID_;
417 }
418 void instrumentID(common::SecurityID_t i) noexcept(true) {
419 instrumentID_=i;
420 }
421
422 common::Price_t limitPrice() const noexcept(true) {
423 return limitPrice_;
424 }
425 void limitPrice(common::Price_t p) noexcept(true) {
426 limitPrice_=p;
427 }
428
429 order_qty_t orderQty() const noexcept(true) {
430 return orderQty_;
431 }
432 void orderQty(order_qty_t i) noexcept(true) {
433 orderQty_=i;
434 }
435
436 common::TIF tif() const noexcept(true) {
437 return tif_;
438 }
439 void tif(common::TIF t) noexcept(true) {
440 tif_=t;
441 }
442 } __attribute__((packed));
443
444
445
446
447 struct ExecutionReport : public common::Header {
448 using Header_t=common::Header;
449 enum : common::MsgType_t {
450 type_const=static_cast<common::MsgType_t>(common::ServerMsgType::ExecutionReport)
451 };
452 enum : std::size_t {
453 header_t_size=sizeof(Header_t)
454 };
455 using RejectCode_t=mit_jse::reject_codes_enum;
456 using order_qty_t=std::int32_t;
457
458 common::AppID partitionID;
459 std::int32_t sequenceNumber;
460 ExecutionID_t executionID{};
461 common::ClientOrderID_t clientOrderID_;
462 common::OrderID_t orderID{};
463 common::ExecType execType_;
464 common::OrderStatus orderStatus_{};
465 RejectCode_t orderRejectCode_{};
466 common::Price_t executedPrice_;
467 order_qty_t executedQty_{};
468 order_qty_t leavesQty_{};
469 common::Container container_{};
470 common::SecurityID_t instrumentID_;
471 common::Side side_;
472 TraderMnemonic_t traderMnemonic{"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
473 common::Account_t account{"\0\0\0\0\0\0\0\0\0"};
474 common::IsMarketOpsRequest isMarketOpsRequest{};
475 common::TransactTime_t transactTime{};
476 const common::OrderBook orderBook=common::OrderBook::Regular;
477 common::ExecInstruction execInstuction_{};
478 common::CrossID_t crossID_{};
479 common::CrossType crossType_{};
480
481 ExecutionReport() noexcept(true) FORCE_INLINE;
482 constexpr ExecutionReport(std::int32_t seqNum, common::ClientOrderID_t const &clID, common::AppID aID, common::ExecType eT, common::Price_t const price, common::SecurityID_t instID, common::Side s) noexcept(true) FORCE_INLINE;
483
484 common::ExecType execType() const noexcept(true) {
485 return execType_;
486 }
487 void execType(common::ExecType e) noexcept(true) {
488 execType_=e;
489 }
490
491 common::ClientOrderID_t const &clientOrderID() const noexcept(true) {
492 return clientOrderID_;
493 }
494 void clientOrderID(common::ClientOrderID_t const &clID) noexcept(true) {
495 jmmcg::memcpy_opt(clID, clientOrderID_);
496 }
497
498 common::SecurityID_t instrumentID() const noexcept(true) {
499 return instrumentID_;
500 }
501 void instrumentID(common::SecurityID_t i) noexcept(true) {
502 instrumentID_=i;
503 }
504
505 common::Price_t executedPrice() const noexcept(true) {
506 return executedPrice_;
507 }
508 void executedPrice(common::Price_t p) noexcept(true) {
509 executedPrice_=p;
510 }
511
512 common::OrderStatus orderStatus() const noexcept(true) {
513 return orderStatus_;
514 }
515 void orderStatus(common::OrderStatus os) noexcept(true) {
516 orderStatus_=os;
517 }
518
519 int32_t executedQty() const noexcept(true) {
520 return executedQty_;
521 }
522 void executedQty(std::int32_t eq) noexcept(true) {
523 executedQty_=eq;
524 }
525
526 int32_t leavesQty() const noexcept(true) {
527 return leavesQty_;
528 }
529 void leavesQty(std::int32_t eq) noexcept(true) {
530 leavesQty_=eq;
531 }
532
533 common::Side side() const noexcept(true) {
534 return side_;
535 }
536 void side(common::Side s) noexcept(true) {
537 side_=s;
538 }
539
540 RejectCode_t orderRejectCode() const noexcept(true) {
541 return orderRejectCode_;
542 }
543 void orderRejectCode(RejectCode_t r) noexcept(true) {
544 orderRejectCode_=r;
545 }
546 } __attribute__((packed));
547
548
549
550
551 struct OrderCancelRejectSpecific {
552 using RejectCode_t=mit_jse::reject_codes_enum;
553 using RejectCodes_t=std::underlying_type<RejectCode_t>::type;
554
555 common::TransactTime_t transactTime;
556 RejectCode_t cancelRejectReason_;
557 const common::OrderBook orderBook=common::OrderBook::Regular;
558 } __attribute__((packed));
559
560
561
562
563 struct OrderMassCancelReportSpecific {
564 using RejectCode_t=mit_jse::reject_codes_enum;
565 using RejectCodes_t=std::underlying_type<RejectCode_t>::type;
566
567 common::TransactTime_t transactTime;
568 const common::OrderBook orderBook=common::OrderBook::Regular;
569 } __attribute__((packed));
570
571
572
573
574 struct BusinessRejectSpecific {
575 using RejectCode_t=mit_jse::reject_codes_enum;
576 using RejectCodes_t=std::underlying_type<RejectCode_t>::type;
577 static constexpr const RejectCode_t unknown_instrument=mit_jse::reject_codes_enum::MatchingEngine_Unknown_instrument_9000;
578 } __attribute__((packed));
579
580 struct OrderCancelRequest : public common::OrderCancelRequest<OrderCancelRequestSpecific1> {
581 using base_t=common::OrderCancelRequest<OrderCancelRequestSpecific1>;
582 using base_t::base_t;
583 using ref_data_t=common::ref_data_t;
584
585
586
587
588
589
590
591 template<class SrcMsg> explicit __stdcall
592 OrderCancelRequest(SrcMsg const &msg, ref_data_t rd) noexcept(true);
593 };
594
595 struct MsgTypes {
596
597 static inline constexpr const isimud::exchanges::common::mic_codes::ISO_10383_MIC_Codes MIC_code=isimud::exchanges::common::mic_codes::ISO_10383_MIC_Codes::ISO_10383_SOUTH_AFRICA_XJSE;
598
599 using ref_data=common::ref_data;
600 using ref_data_t=common::ref_data_t;
601
602 using MsgTypes_t=common::MsgType_t;
603 using UserName_t=JSE::CompID_t;
604 using Password_t=JSE::Password_t;
605 using SecurityID_t=common::SecurityID_t;
606 using Price_t=common::Price_t;
607 using ClientOrderID_t=common::ClientOrderID_t;
608 using OrderType=common::OrderType;
609 using Side=common::Side;
610 using ExecType=common::ExecType;
611 using AppID=common::AppID;
612 using OrderStatus=common::OrderStatus;
613 using logon_args_t=JSE::logon_args_t;
614
615 using Header_t=common::Header;
616 using LogonRequest=JSE::Logon;
617 using LogonReply=JSE::LogonResponse;
618 using LogoutRequest=common::LogoutRequest;
619 using Logout=LogoutRequest;
620 using ClientHeartbeat=common::Heartbeat;
621 using ServerHeartbeat=common::Heartbeat;
622 using Reject=common::Reject<mit_jse::reject_codes_enum, static_cast<mit_jse::reject_codes_enum>(102)>;
623 using MissedMessageRequest=common::MissedMessageRequest;
624 using MissedMessageRequestAck=common::MissedMessageRequestAck;
625 using MissedMessageReport=common::MissedMessageReport;
626 using TransmissionComplete=JSE::TransmissionComplete;
627 using SystemStatus=common::SystemStatus;
628 using NewOrder=JSE::NewOrder;
629 using OrderCancelRequest=JSE::OrderCancelRequest;
630 using OrderMassCancelRequest=common::OrderMassCancelRequest<OrderMassCancelRequestSpecific1, OrderMassCancelRequestSpecific2>;
631 using OrderCancelReplaceRequest=JSE::OrderCancelReplaceRequest;
632 using NewOrderCross=JSE::NewOrderCross;
633 using ExecutionReport=JSE::ExecutionReport;
634 using OrderCancelReject=common::OrderCancelReject<OrderCancelRejectSpecific>;
635 using OrderMassCancelReport=common::OrderMassCancelReport<OrderMassCancelReportSpecific>;
636 using BusinessReject=common::BusinessReject<BusinessRejectSpecific>;
637
638 static inline constexpr MsgTypes_t MatchAll=std::numeric_limits<MsgTypes_t>::max()-1;
639 static inline constexpr MsgTypes_t Exit=std::numeric_limits<MsgTypes_t>::max();
640
641 using client_to_exchange_messages_t=boost::mpl::vector<
642 NewOrder,
643 OrderCancelRequest,
644 OrderMassCancelRequest,
645 OrderCancelReplaceRequest,
646 NewOrderCross,
647 LogonRequest,
648 LogoutRequest,
649 ClientHeartbeat,
650 MissedMessageRequest
651 >;
652
653 using exchange_to_client_messages_t=boost::mpl::vector<
654 TransmissionComplete,
655 ExecutionReport,
656 OrderCancelReject,
657 OrderMassCancelReport,
658 BusinessReject,
659 LogonReply,
660 Logout,
661 ServerHeartbeat,
662 MissedMessageReport,
663 MissedMessageRequestAck,
664 Reject,
665 SystemStatus
666 >;
667
668 enum : std::size_t {
669 min_size_client_to_exchange_msg=sizeof(
670 boost::mpl::deref<
671 boost::mpl::min_element<
672 boost::mpl::transform_view<client_to_exchange_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
673 >::type::base
674 >::type
675 ),
676 max_size_client_to_exchange_msg=sizeof(
677 boost::mpl::deref<
678 boost::mpl::max_element<
679 boost::mpl::transform_view<client_to_exchange_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
680 >::type::base
681 >::type
682 ),
683 min_size_exchange_to_client_msg=sizeof(
684 boost::mpl::deref<
685 boost::mpl::min_element<
686 boost::mpl::transform_view<exchange_to_client_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
687 >::type::base
688 >::type
689 ),
690 max_size_exchange_to_client_msg=sizeof(
691 boost::mpl::deref<
692 boost::mpl::max_element<
693 boost::mpl::transform_view<exchange_to_client_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
694 >::type::base
695 >::type
696 ),
697 min_msg_size=jmmcg::min<std::size_t, min_size_client_to_exchange_msg, min_size_exchange_to_client_msg>::value,
698 max_msg_size=jmmcg::max<std::size_t, max_size_client_to_exchange_msg, max_size_exchange_to_client_msg>::value,
699 header_t_size=LogonRequest::header_t_size
700 };
701 BOOST_MPL_ASSERT_RELATION(max_msg_size, >=, header_t_size);
702
703 using msg_buffer_t=std::array<std::uint8_t, max_msg_size>;
704 using client_to_exchange_messages_container=boost::make_variant_over<client_to_exchange_messages_t>::type;
705 using exchange_to_client_messages_container=boost::make_variant_over<exchange_to_client_messages_t>::type;
706
707 static inline constexpr Price_t implied_decimal_places=common::implied_decimal_places;
708
709 static std::ostream &to_stream(std::ostream &) noexcept(false);
710 };
711
712
713
714
715 namespace tests {
716
717 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::Header_t), <=, MsgTypes::max_size_client_to_exchange_msg);
718 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::Header_t), <=, MsgTypes::max_size_exchange_to_client_msg);
719 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::Header_t), <=, MsgTypes::max_msg_size);
720 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::LogonRequest), ==, 30);
721 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::LogonReply), ==, 12);
722 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::LogoutRequest), ==, 24);
723 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::ClientHeartbeat), ==, 4);
724 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::ServerHeartbeat), ==, 4);
725 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::Reject), ==, 59);
726 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::MissedMessageRequest), ==, 9);
727 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::MissedMessageRequestAck), ==, 5);
728 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::TransmissionComplete), ==, 5);
729 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::SystemStatus), ==, 6);
730 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::NewOrder), ==, 108);
731 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::OrderCancelRequest), ==, 88);
732 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::OrderMassCancelRequest), ==, 37);
733 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::OrderCancelReplaceRequest), ==, 136);
734 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::NewOrderCross), ==, 139);
735 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::ExecutionReport), ==, 149);
736 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::OrderCancelReject), ==, 54);
737 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::OrderMassCancelReport), ==, 43);
738 BOOST_MPL_ASSERT_RELATION(sizeof(MsgTypes::BusinessReject), ==, 54);
739
740 }
741
742 } } } }
743
744 #include "messages_impl.hpp"
745
746 #endif