root/isimud/exchanges/BATSBOE/common/messages.hpp

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. type

   1 #ifndef libjmmcg_isimud_exchanges_BATSBOE_common_messages_hpp
   2 #define libjmmcg_isimud_exchanges_BATSBOE_common_messages_hpp
   3 
   4 /******************************************************************************
   5 ** $Header: svn+ssh://jmmcg@svn.code.sf.net/p/libjmmcg/code/trunk/libjmmcg/isimud/exchanges/BATSBOE/common/messages.hpp 2223 2017-11-09 00:24:31Z jmmcg $
   6 **
   7 ** Copyright (c) 2015 by J.M.McGuiness, isimud@hussar.me.uk
   8 **
   9 ** This library is free software; you can redistribute it and/or
  10 ** modify it under the terms of the GNU Lesser General Public
  11 ** License as published by the Free Software Foundation; either
  12 ** version 2.1 of the License, or (at your option) any later version.
  13 **
  14 ** This library is distributed in the hope that it will be useful,
  15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17 ** Lesser General Public License for more details.
  18 **
  19 ** You should have received a copy of the GNU Lesser General Public
  20 ** License along with this library; if not, write to the Free Software
  21 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 */
  23 
  24 #include "types.hpp"
  25 #include "optional_field_types.hpp"
  26 
  27 #include "../../common/iso_10383_mic_codes.hpp"
  28 
  29 #include "core/memops.hpp"
  30 
  31 #include <chrono>
  32 
  33 namespace isimud { namespace exchanges { namespace BATSBOE {
  34 
  35 /**
  36         From <a href="http://cdn.batstrading.com/resources/participant_resources/BATS_Europe_Binary_Order_Entry_Specification.pdf>"BATS Chi-X Europe Binary Order Entry Specification", Version 1.44, 27 November, 2014</a>
  37 */
  38 namespace common {
  39 
  40 const uint16_t msg_start_code=0xBABA;   
  41 struct logon_args_t {
  42         const uint32_t seqNum{};
  43         const SessionSubID_t sessionSubID{};
  44         const UserName_t username{{}};
  45         const Password_t password{{}};
  46         const bool noUnspec{};
  47 };
  48 struct logoff_args_t {
  49         const uint32_t seqNum{};
  50 };
  51 
  52 /**
  53         Section: "3.1.1 Login Request"
  54 */
  55 template<class MsgT, MsgT Msg>
  56 class Header {
  57 public:
  58         using MsgType_t=MsgT;
  59         using MsgTypes_t=common::MsgType_t;
  60         enum : typename std::underlying_type<MsgType_t>::type {
  61                 type_const=static_cast<typename std::underlying_type<MsgType_t>::type>(Msg)
  62         };
  63         enum : bool {
  64                 has_static_size=false   ///< The message is dynamically-sized, not statically, so sizeof(MsgT) is the maximum amount to copy, but it could be less, given by length().
  65         };
  66 
  67         const uint16_t start_of_message=msg_start_code;
  68 
  69 protected:
  70         uint16_t length_;
  71 
  72 public:
  73         const MsgType_t type_{Msg};
  74         const uint8_t matchingUnit=0;
  75         const uint32_t sequenceNumber;
  76 
  77         explicit Header(std::size_t l) noexcept(true) FORCE_INLINE;
  78         Header(std::size_t l, uint32_t seqNumber) noexcept(true) FORCE_INLINE;
  79 
  80         const MsgType_t type() const noexcept(true) {
  81                 return type_;
  82         }
  83 
  84         /// The actual, not the foolish BATSBOE-specified, length which excludes the start_of_message field.
  85         uint16_t length() const noexcept(true);
  86 
  87 protected:
  88         ~Header() noexcept(true)=default;
  89 } __attribute__((packed));
  90 
  91 /**
  92         Section: "3.1.1 Login Request"
  93 */
  94 template<class MsgT, MsgT Msg>
  95 struct LogonRequest : public Header<MsgT, Msg> {
  96         using Header_t=Header<MsgT, Msg>;
  97         enum : std::size_t {
  98                 header_t_size=sizeof(Header_t)
  99         };
 100 
 101         const SessionSubID_t sessionSubID;
 102         const UserName_t userName;
 103         const Password_t password;
 104         const uint8_t noUnspecifiedUnitReplay;
 105         optional::LogonTypes::OrderAcknowledgement::bitfields orderAcknowledgement_bitfields;
 106         optional::LogonTypes::OrderRejected::bitfields orderRejected_bitfields;
 107         optional::LogonTypes::OrderModified::bitfields orderModified_bitfields;
 108         optional::LogonTypes::OrderRestated::bitfields orderRestated_bitfields;
 109         const optional::LogonTypes::UserModifyRejected::bitfields userModifyRejected_bitfields;
 110         optional::LogonTypes::OrderCancelled::bitfields orderCancelled_bitfields;
 111         optional::LogonTypes::OrderExecution::bitfields orderExecution_bitfields;
 112         optional::LogonTypes::TradeCancelCorrect::bitfields tradeCancelCorrect_bitfields;
 113         optional::LogonTypes::Reserved::bitfields reserved_bitfields;
 114         optional::LogonTypes::TradeCaptureReportAck::bitfields tradeCaptureReportAck_bitfields;
 115         optional::LogonTypes::TradeCaptureReportRej::bitfields tradeCaptureReportRej_bitfields;
 116         optional::LogonTypes::TradeCaptureConfirm::bitfields tradeCaptureConfirm_bitfields;
 117         optional::LogonTypes::TradeCaptureDecline::bitfields tradeCaptureDecline_bitfields;
 118         const uint8_t reserved[128]={0};
 119         const uint8_t numberOfUnits=0;
 120 
 121         LogonRequest(uint32_t seqNum, const SessionSubID_t sessionSubID, const UserName_t &UN, const Password_t &P, const bool noUnspec) noexcept(true) FORCE_INLINE;
 122         explicit LogonRequest(logon_args_t const &a) noexcept(true) FORCE_INLINE;
 123 
 124         /// Create a message from the source message.
 125         /**
 126                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 127 
 128                 \param  msg     The source message from which the target message should be created.
 129         */
 130         template<class SrcMsg> __stdcall
 131         LogonRequest(SrcMsg const &msg, uint32_t seqNum, const SessionSubID_t sessionSubID, const bool noUnspec)=delete FORCE_INLINE;
 132 } __attribute__((packed));
 133 
 134 /**
 135         Section: "3.1.2 Logout request"
 136 */
 137 struct LogoutRequest : public Header<MsgType, MsgType::LogoutRequest> {
 138         using Header_t=Header<MsgType, MsgType::LogoutRequest>;
 139         enum : std::size_t {
 140                 header_t_size=sizeof(Header_t)
 141         };
 142 
 143         explicit LogoutRequest(uint32_t seqNum) noexcept(true) FORCE_INLINE;
 144         explicit LogoutRequest(logoff_args_t const &a) noexcept(true) FORCE_INLINE;
 145 
 146         /// Create a message from the source message.
 147         /**
 148                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 149 
 150                 \param  msg     The source message from which the target message should be created.
 151         */
 152         template<class SrcMsg> explicit __stdcall
 153         LogoutRequest(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 154 } __attribute__((packed));
 155 
 156 /**
 157         Section: "3.1.3 Client Heartbeat" & "2.4 Heartbeats".
 158 */
 159 struct ClientHeartbeat : public Header<MsgType, MsgType::ClientHeartbeat> {
 160         using Header_t=Header<MsgType, MsgType::ClientHeartbeat>;
 161         enum : std::size_t {
 162                 header_t_size=sizeof(Header_t)
 163         };
 164         enum : uint32_t {
 165                 seq_num=0
 166         };
 167 
 168         explicit ClientHeartbeat(uint32_t seqNum) noexcept(true) FORCE_INLINE;
 169 
 170         /// Create a message from the source message.
 171         /**
 172                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 173 
 174                 \param  msg     The source message from which the target message should be created.
 175         */
 176         template<class SrcMsg> explicit __stdcall
 177         ClientHeartbeat(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 178 } __attribute__((packed));
 179 
 180 /**
 181         Section: "3.2.1 Login Response"
 182 */
 183 template<class MsgT, MsgT Msg>
 184 struct LogonReply : public Header<MsgT, Msg> {
 185         using Header_t=Header<MsgT, Msg>;
 186         enum : std::size_t {
 187                 header_t_size=sizeof(Header_t)
 188         };
 189         /// Allow a client connected to the exchange to process the LogonReply message.
 190         struct respond;
 191 
 192         static constexpr const LoginResponseStatus logon_success=LoginResponseStatus::LoginAccepted;
 193 
 194         LoginResponseStatus loginResponseStatus;
 195 
 196         LogonReply() noexcept(true) FORCE_INLINE;
 197         explicit LogonReply(uint32_t seqNum) noexcept(true) FORCE_INLINE;
 198 
 199         LoginResponseStatus rejectCode() const noexcept(true) FORCE_INLINE {
 200                 return loginResponseStatus;
 201         }
 202         void rejectCode(LoginResponseStatus const &rc) noexcept(true) FORCE_INLINE {
 203                 loginResponseStatus=rc;
 204         }
 205 } __attribute__((packed));
 206 
 207 /**
 208         Section: "3.2.2 Logout"
 209 */
 210 struct Logout : public Header<MsgType, MsgType::Logout> {
 211         using Header_t=Header<MsgType, MsgType::Logout>;
 212         enum : std::size_t {
 213                 header_t_size=sizeof(Header_t)
 214         };
 215 
 216         LogoutReason logoutReason;
 217         LogoutReasonText_t logoutReasonText;
 218         uint32_t lastReceivedSequenceNumber;
 219         const uint8_t numberOfUnits=0;
 220 
 221         Logout() noexcept(true) FORCE_INLINE;
 222         Logout(uint32_t seqNum, LogoutReason lr) noexcept(true) FORCE_INLINE;
 223 } __attribute__((packed));
 224 
 225 /**
 226         Section: "3.2.3 Server Heartbeat" & "2.4 Heartbeats".
 227 */
 228 struct ServerHeartbeat : public Header<MsgType, MsgType::ServerHeartbeat> {
 229         using Header_t=Header<MsgType, MsgType::ServerHeartbeat>;
 230         enum : std::size_t {
 231                 header_t_size=sizeof(Header_t)
 232         };
 233         enum : uint32_t {
 234                 seq_num=0
 235         };
 236 
 237         explicit ServerHeartbeat(uint32_t seqNum) noexcept(true) FORCE_INLINE;
 238 
 239         /// Create a message from the source message.
 240         /**
 241                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 242 
 243                 \param  msg     The source message from which the target message should be created.
 244         */
 245         template<class SrcMsg> explicit __stdcall
 246         ServerHeartbeat(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 247 } __attribute__((packed));
 248 
 249 /**
 250         Section: "3.2.4 Replay Complete"
 251 */
 252 struct ReplayComplete : public Header<MsgType, MsgType::ReplayComplete> {
 253         using Header_t=Header<MsgType, MsgType::ReplayComplete>;
 254         enum : std::size_t {
 255                 header_t_size=sizeof(Header_t)
 256         };
 257 
 258         explicit ReplayComplete(uint32_t seqNum) noexcept(true) FORCE_INLINE;
 259 } __attribute__((packed));
 260 
 261 /**
 262         Section: "4.1.1 New Order"
 263 */
 264 struct NewOrder : public Header<MsgType, MsgType::NewOrder> {
 265         using Header_t=Header<MsgType, MsgType::NewOrder>;
 266         using bitfields_to_type_map=optional::NewOrder::bitfields_to_type_map;
 267         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 268         enum : std::size_t {
 269                 header_t_size=sizeof(Header_t)
 270         };
 271 
 272         explicit NewOrder(uint32_t seqNum, ClientOrderID_t const &clID, OrdType const oT, TIF const t, Side const s, SecurityID_t instID, int32_t ordQty, Price_t p) noexcept(true) FORCE_INLINE;
 273         /// Create a message from the source message.
 274         /**
 275                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 276 
 277                 \param  msg     The source message from which the target message should be created.
 278         */
 279         template<class SrcMsg> explicit __stdcall
 280         NewOrder(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 281 
 282         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 283                 return clientOrderID_;
 284         }
 285         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 286                 jmmcg::memcpy_opt(clID, clientOrderID_);
 287         }
 288 
 289         int32_t orderQty() const noexcept(true) {
 290                 return orderQty_;
 291         }
 292         void orderQty(int32_t i) noexcept(true) {
 293                 orderQty_=i;
 294         }
 295 
 296         OrdType const &orderType() const noexcept(true);
 297         void orderType(OrdType const &i) noexcept(true);
 298 
 299         common::Side side() const noexcept(true) {
 300                 return side_;
 301         }
 302         void side(common::Side i) noexcept(true) {
 303                 side_=i;
 304         }
 305 
 306         SecurityID_t const &instrumentID() const noexcept(true);
 307         void instrumentID(SecurityID_t const &i) noexcept(true);
 308 
 309         Price_t limitPrice() const noexcept(true);
 310         void limitPrice(Price_t p) noexcept(true);
 311 
 312         TIF tif() const noexcept(true);
 313         void tif(TIF t) noexcept(true);
 314 
 315 private:
 316         ClientOrderID_t clientOrderID_;
 317         common::Side side_;
 318         uint32_t orderQty_;
 319         bitfields_to_type_map bitfields;
 320 } __attribute__((packed));
 321 
 322 /**
 323         Section: "4.1.2 Cancel Order"
 324 */
 325 struct CancelOrder : public Header<MsgType, MsgType::CancelOrder> {
 326         using Header_t=Header<MsgType, MsgType::CancelOrder>;
 327         using bitfields_to_type_map=optional::CancelOrder::bitfields_to_type_map;
 328         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 329         enum : std::size_t {
 330                 header_t_size=sizeof(Header_t)
 331         };
 332 
 333         CancelOrder(uint32_t seqNum, ClientOrderID_t const &origclID) noexcept(true) FORCE_INLINE;
 334         /// Create a message from the source message.
 335         /**
 336                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 337 
 338                 \param  msg     The source message from which the target message should be created.
 339         */
 340         template<class SrcMsg> __stdcall
 341         CancelOrder(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 342 
 343         ClientOrderID_t const &originalClientOrderID() const noexcept(true) {
 344                 return originalClientOrderID_;
 345         }
 346         void originalClientOrderID(ClientOrderID_t const &origclID) noexcept(true) {
 347                 jmmcg::memcpy_opt(origclID, originalClientOrderID_);
 348         }
 349 
 350 private:
 351         ClientOrderID_t originalClientOrderID_;
 352         bitfields_to_type_map bitfields;
 353 } __attribute__((packed));
 354 
 355 /**
 356         Section: "4.1.3 Modify Order"
 357 */
 358 struct ModifyOrder : public Header<MsgType, MsgType::ModifyOrder> {
 359         using Header_t=Header<MsgType, MsgType::ModifyOrder>;
 360         using bitfields_to_type_map=optional::ModifyOrder::bitfields_to_type_map;
 361         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 362         enum : std::size_t {
 363                 header_t_size=sizeof(Header_t)
 364         };
 365 
 366         ModifyOrder(uint32_t seqNum, ClientOrderID_t const &clID, uint32_t ordQty, Price_t p, Side s) noexcept(true) FORCE_INLINE;
 367 
 368         /// Create a message from the source message.
 369         /**
 370                 If an error is generated, then this function will need to be specialised for the particular Msg-type.
 371 
 372                 \param  msg     The source message from which the target message should be created.
 373         */
 374         template<class SrcMsg> explicit __stdcall
 375         ModifyOrder(SrcMsg const &msg, uint32_t seqNum) noexcept(true)=delete FORCE_INLINE;
 376 
 377         ClientOrderID_t const &originalClientOrderID() const noexcept(true) {
 378                 return originalClientOrderID_;
 379         }
 380         void originalClientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 381                 jmmcg::memcpy_opt(clID, originalClientOrderID_);
 382         }
 383 
 384         Price_t limitPrice() const noexcept(true);
 385         void limitPrice(Price_t p) noexcept(true);
 386 
 387         uint32_t orderQty() const noexcept(true);
 388         void orderQty(uint32_t i) noexcept(true);
 389 
 390         Side side() const noexcept(true);
 391         void side(Side i) noexcept(true);
 392 
 393 private:
 394         ClientOrderID_t clientOrderID_;
 395         ClientOrderID_t originalClientOrderID_;
 396         bitfields_to_type_map bitfields;
 397 } __attribute__((packed));
 398 
 399 /**
 400         Section: "4.2.1 Order Acknowledgement"
 401 */
 402 struct OrderAcknowledgement : public Header<MsgType, MsgType::OrderAcknowledgement> {
 403         using Header_t=Header<MsgType, MsgType::OrderAcknowledgement>;
 404         using bitfields_to_type_map=optional::OrderAcknowledgement::bitfields_to_type_map;
 405         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 406         enum : std::size_t {
 407                 header_t_size=sizeof(Header_t)
 408         };
 409 
 410         const DateTime_t transactionTime;
 411 
 412         explicit OrderAcknowledgement(uint32_t seqNum, ClientOrderID_t const &clID) noexcept(true) FORCE_INLINE;
 413 
 414         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 415                 return clientOrderID_;
 416         }
 417         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 418                 jmmcg::memcpy_opt(clID, clientOrderID_);
 419         }
 420 
 421 private:
 422         ClientOrderID_t clientOrderID_;
 423         uint64_t orderID;
 424         bitfields_to_type_map bitfields;
 425 } __attribute__((packed));
 426 
 427 /**
 428         Section: "4.2.2 Order Rejected"
 429 */
 430 struct OrderRejected : public Header<MsgType, MsgType::OrderRejected> {
 431         using Header_t=Header<MsgType, MsgType::OrderRejected>;
 432         using bitfields_to_type_map=optional::OrderRejected::bitfields_to_type_map;
 433         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 434         enum : std::size_t {
 435                 header_t_size=sizeof(Header_t)
 436         };
 437 
 438         const DateTime_t transactionTime;
 439 
 440         OrderRejected() noexcept(true) FORCE_INLINE;
 441         OrderRejected(uint32_t seqNum, ClientOrderID_t const &clID, OrderRejectReason orr) noexcept(true) FORCE_INLINE;
 442 
 443         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 444                 return clientOrderID_;
 445         }
 446         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 447                 jmmcg::memcpy_opt(clID, clientOrderID_);
 448         }
 449 
 450 private:
 451         ClientOrderID_t clientOrderID_;
 452 
 453 public:
 454         const OrderRejectReason orderRejectReason;
 455 
 456 private:
 457         Text_t text;
 458         bitfields_to_type_map bitfields;
 459 } __attribute__((packed));
 460 
 461 /**
 462         Section: "4.2.3 Order Modified"
 463 */
 464 struct OrderModified : public Header<MsgType, MsgType::OrderModified> {
 465         using Header_t=Header<MsgType, MsgType::OrderModified>;
 466         using bitfields_to_type_map=optional::OrderModified::bitfields_to_type_map;
 467         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 468         enum : std::size_t {
 469                 header_t_size=sizeof(Header_t)
 470         };
 471 
 472         const DateTime_t transactionTime;
 473 
 474         explicit OrderModified() noexcept(true) FORCE_INLINE;
 475         explicit OrderModified(uint32_t seqNum, ClientOrderID_t const &clID, Price_t p, Side s, uint32_t ordQty) noexcept(true) FORCE_INLINE;
 476 
 477         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 478                 return clientOrderID_;
 479         }
 480         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 481                 jmmcg::memcpy_opt(clID, clientOrderID_);
 482         }
 483 
 484         Price_t limitPrice() const noexcept(true);
 485         void limitPrice(Price_t p) noexcept(true);
 486 
 487         uint32_t orderQty() const noexcept(true);
 488         void orderQty(uint32_t i) noexcept(true);
 489 
 490         Side side() const noexcept(true);
 491         void side(Side i) noexcept(true);
 492 
 493 private:
 494         ClientOrderID_t clientOrderID_;
 495         uint64_t orderID;
 496         bitfields_to_type_map bitfields;
 497 } __attribute__((packed));
 498 
 499 /**
 500         Section: "4.2.4 Order Restated"
 501 */
 502 struct OrderRestated : public Header<MsgType, MsgType::OrderRestated> {
 503         using Header_t=Header<MsgType, MsgType::OrderRestated>;
 504         using bitfields_to_type_map=optional::OrderRestated::bitfields_to_type_map;
 505         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 506         enum : std::size_t {
 507                 header_t_size=sizeof(Header_t)
 508         };
 509 
 510         const DateTime_t transactionTime;
 511 
 512         explicit OrderRestated(uint32_t seqNum, ClientOrderID_t const &clID) noexcept(true) FORCE_INLINE;
 513 
 514         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 515                 return clientOrderID_;
 516         }
 517         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 518                 jmmcg::memcpy_opt(clID, clientOrderID_);
 519         }
 520 
 521 private:
 522         ClientOrderID_t clientOrderID_;
 523         uint64_t orderID;
 524         RestatementReason restatementReason;
 525         bitfields_to_type_map bitfields;
 526 } __attribute__((packed));
 527 
 528 /**
 529         Section: "4.2.5 User Modify Rejected"
 530 */
 531 struct UserModifyRejected : public Header<MsgType, MsgType::UserModifyRejected> {
 532         using Header_t=Header<MsgType, MsgType::UserModifyRejected>;
 533         using bitfields_to_type_map=optional::UserModifyRejected::bitfields_to_type_map;
 534         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 535         enum : std::size_t {
 536                 header_t_size=sizeof(Header_t)
 537         };
 538 
 539         const DateTime_t transactionTime;
 540 
 541         UserModifyRejected() noexcept(true) FORCE_INLINE;
 542         explicit UserModifyRejected(uint32_t seqNum, ClientOrderID_t const &clID, OrderRejectReason orr) noexcept(true) FORCE_INLINE;
 543 
 544         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 545                 return clientOrderID_;
 546         }
 547         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 548                 jmmcg::memcpy_opt(clID, clientOrderID_);
 549         }
 550 
 551 private:
 552         ClientOrderID_t clientOrderID_;
 553         uint64_t orderID;
 554 
 555 public:
 556         const OrderRejectReason modifyRejectReason;
 557 
 558 private:
 559         Text_t text;
 560         bitfields_to_type_map bitfields;
 561 } __attribute__((packed));
 562 
 563 /**
 564         Section: "4.2.6 Order Cancelled"
 565 */
 566 struct OrderCancelled : public Header<MsgType, MsgType::OrderCancelled> {
 567         using Header_t=Header<MsgType, MsgType::OrderCancelled>;
 568         using bitfields_to_type_map=optional::OrderCancelled::bitfields_to_type_map;
 569         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 570         enum : std::size_t {
 571                 header_t_size=sizeof(Header_t)
 572         };
 573 
 574         const DateTime_t transactionTime;
 575 
 576         explicit OrderCancelled() noexcept(true) FORCE_INLINE;
 577         explicit OrderCancelled(uint32_t seqNum, ClientOrderID_t const &clID, OrderRejectReason orr, Price_t p, Side s, uint32_t ls, uint32_t ordQty) noexcept(true) FORCE_INLINE;
 578 
 579         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 580                 return clientOrderID_;
 581         }
 582         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 583                 jmmcg::memcpy_opt(clID, clientOrderID_);
 584         }
 585 
 586         Side side() const noexcept(true);
 587 
 588         uint32_t orderQty() const noexcept(true);
 589 
 590         uint32_t leavesQty() const noexcept(true);
 591 
 592         uint32_t lastShares() const noexcept(true);
 593 
 594         Price_t lastPrice() const noexcept(true);
 595 
 596 private:
 597         ClientOrderID_t clientOrderID_;
 598 
 599 public:
 600         const OrderRejectReason cancelReason;
 601 
 602 private:
 603         bitfields_to_type_map bitfields;
 604 } __attribute__((packed));
 605 
 606 /**
 607         Section: "4.2.7 Cancel Rejected"
 608 */
 609 struct CancelRejected : public Header<MsgType, MsgType::CancelRejected> {
 610         using Header_t=Header<MsgType, MsgType::CancelRejected>;
 611         using bitfields_to_type_map=optional::CancelRejected::bitfields_to_type_map;
 612         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 613         enum : std::size_t {
 614                 header_t_size=sizeof(Header_t)
 615         };
 616 
 617         const DateTime_t transactionTime;
 618 
 619         CancelRejected() noexcept(true) FORCE_INLINE;
 620         CancelRejected(uint32_t seqNum, ClientOrderID_t const &clID, OrderRejectReason crr) noexcept(true) FORCE_INLINE;
 621 
 622         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 623                 return clientOrderID_;
 624         }
 625         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 626                 jmmcg::memcpy_opt(clID, clientOrderID_);
 627         }
 628 
 629 private:
 630         ClientOrderID_t clientOrderID_;
 631         
 632 public:
 633         const OrderRejectReason cancelRejectReason;
 634 
 635 private:
 636         Text_t text;
 637         bitfields_to_type_map bitfields;
 638 } __attribute__((packed));
 639 
 640 /**
 641         Section: "4.2.8 Order Execution"
 642 */
 643 struct OrderExecution : public Header<MsgType, MsgType::OrderExecution> {
 644         using Header_t=Header<MsgType, MsgType::OrderExecution>;
 645         using bitfields_to_type_map=optional::OrderExecution::bitfields_to_type_map;
 646         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 647         enum : std::size_t {
 648                 header_t_size=sizeof(Header_t)
 649         };
 650 
 651         const DateTime_t transactionTime;
 652 
 653         OrderExecution() noexcept(true) FORCE_INLINE;
 654         OrderExecution(int32_t seqNum, ClientOrderID_t const &clID, Price_t const price, SecurityID_t const &instID, Side s) noexcept(true) FORCE_INLINE;
 655 
 656         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 657                 return clientOrderID_;
 658         }
 659         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 660                 jmmcg::memcpy_opt(clID, clientOrderID_);
 661         }
 662 
 663         SecurityID_t const &instrumentID() const noexcept(true);
 664         void instrumentID(SecurityID_t const &i) noexcept(true);
 665         
 666         Price_t executedPrice() const noexcept(true) {
 667                 return lastPx;
 668         }
 669         void executedPrice(Price_t p) noexcept(true) {
 670                 lastPx=p;
 671         }
 672 
 673         int32_t executedQty() const noexcept(true) {
 674                 return lastShares;
 675         }
 676         void executedQty(int32_t eq) noexcept(true) {
 677                 lastShares=eq;
 678         }
 679 
 680         int32_t leavesQty() const noexcept(true) {
 681                 return leavesQty_;
 682         }
 683         void leavesQty(int32_t eq) noexcept(true) {
 684                 leavesQty_=eq;
 685         }
 686 
 687         Side side() const noexcept(true);
 688         void side(Side s) noexcept(true);
 689 
 690 private:
 691         ClientOrderID_t clientOrderID_;
 692         uint64_t execID;
 693         uint32_t lastShares;
 694         Price_t lastPx;
 695         uint32_t leavesQty_;
 696         BaseLiquidityIndicator baseLiquidityIndicator;
 697         SubLiquidityIndicator subLiquidityIndicator;
 698         SPrice_t accessFee;
 699         ContraBroker_t contraBroker;
 700         bitfields_to_type_map bitfields;
 701 } __attribute__((packed));
 702 
 703 /**
 704         Section: "4.2.9 Trade Cancel or Correct"
 705 */
 706 struct TradeCancelOrCorrect : public Header<MsgType, MsgType::TradeCancelOrCorrect> {
 707         using Header_t=Header<MsgType, MsgType::TradeCancelOrCorrect>;
 708         using bitfields_to_type_map=optional::TradeCancelOrCorrect::bitfields_to_type_map;
 709         using bitfields_tags_type=bitfields_to_type_map::bitfields_tags_type;
 710         enum : std::size_t {
 711                 header_t_size=sizeof(Header_t)
 712         };
 713 
 714         const DateTime_t transactionTime;
 715 
 716         explicit TradeCancelOrCorrect(uint32_t seqNum, ClientOrderID_t const &clID) noexcept(true) FORCE_INLINE;
 717 
 718         ClientOrderID_t const &clientOrderID() const noexcept(true) {
 719                 return clientOrderID_;
 720         }
 721         void clientOrderID(ClientOrderID_t const &clID) noexcept(true) {
 722                 jmmcg::memcpy_opt(clID, clientOrderID_);
 723         }
 724 
 725 private:
 726         ClientOrderID_t clientOrderID_;
 727         uint64_t orderID;
 728         uint64_t execRefID;
 729         Side side;
 730         BaseLiquidityIndicator baseLiquidityIndicator;
 731         ClearingFirm_t clearingFirm;
 732         ClearingAccount_t clearingAccount;
 733         uint32_t lastShares;
 734         Price_t lastPx;
 735         Price_t correctedPrice;
 736         DateTime_t origTime;
 737         bitfields_to_type_map bitfields;
 738 } __attribute__((packed));
 739 
 740 } } } }
 741 
 742 #include "messages_impl.hpp"
 743 
 744 #endif

/* [<][>][^][v][top][bottom][index][help] */