1 #ifndef ISIMUD_EXCHANGES_MIT_JSE_MESSAGES_HPP 
    2 #define ISIMUD_EXCHANGES_MIT_JSE_MESSAGES_HPP 
   23 #include "reject_codes.hpp" 
   25 #include "../common/messages.hpp" 
   26 #include "../common/ref_data.hpp" 
   28 #include "core/max_min.hpp" 
   30 #include <boost/mpl/assert.hpp> 
   31 #include <boost/mpl/deref.hpp> 
   32 #include <boost/mpl/max_element.hpp> 
   33 #include <boost/mpl/min_element.hpp> 
   34 #include <boost/mpl/placeholders.hpp> 
   35 #include <boost/mpl/sizeof.hpp> 
   36 #include <boost/mpl/transform_view.hpp> 
   37 #include <boost/mpl/vector.hpp> 
   38 #include <boost/variant/variant.hpp> 
   49 using CompID_t=
std::array<
char, 6>;
 
   50 using ExecutionID_t=
std::array<
char, 21>;
 
   51 using ExpireDateTime_t=
std::array<
char, 17>;
 
   52 using Password_t=
std::array<
char, 10>;
 
   53 using PasswordExpiry_t=
std::int32_t;
 
   54 using TraderMnemonic_t=
std::array<
char, 17>;
 
   55 using Segment_t=
std::array<
char, 6>;
 
   58    using UserName_t=
JSE::CompID_t;
 
   59    using Password_t=
JSE::Password_t;
 
   71    enum : common::MsgType_t {
 
   88    template<
class SrcMsg> 
explicit __stdcall 
   90 } 
__attribute__((packed));
 
  100    enum : common::MsgType_t {
 
  112    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;
 
  121    template<
class SrcMsg> 
explicit __stdcall 
  123 } 
__attribute__((packed));
 
  130    using RejectCode_t=mit_jse::reject_codes_enum;
 
  132    enum : common::MsgType_t {
 
  141    static inline constexpr const RejectCode_t 
logon_success=mit_jse::reject_codes_enum::tag_SUCCESS;
 
  142    static inline constexpr const RejectCode_t 
invalid_logon_details=mit_jse::reject_codes_enum::Native_Trading_Gateway_Invalid_User_ID_or_password_1;
 
  143    static inline constexpr const RejectCode_t 
unknown_user=mit_jse::reject_codes_enum::Native_Trading_Gateway_Invalid_User_ID_or_password_1;
 
  156 } 
__attribute__((packed));
 
  163    enum : common::MsgType_t {
 
  169    using order_qty_t=
std::int32_t;
 
  199    template<
class SrcMsg> 
__stdcall 
  231       return clientOrderID_;
 
  234       libjmmcg::memcpy_opt(clID, clientOrderID_);
 
  250 } 
__attribute__((packed));
 
  268 } 
__attribute__((packed));
 
  286 } 
__attribute__((packed));
 
  289 } 
__attribute__((packed));
 
  295    enum : common::MsgType_t {
 
  301    using order_qty_t=
std::int32_t;
 
  329    template<
class SrcMsg> 
__stdcall 
  340       return clientOrderID_;
 
  343       libjmmcg::memcpy_opt(clID, clientOrderID_);
 
  347       return originalClientOrderID_;
 
  350       libjmmcg::memcpy_opt(clID, originalClientOrderID_);
 
  380 } 
__attribute__((packed));
 
  387    enum : common::MsgType_t {
 
  393    using order_qty_t=
std::int32_t;
 
  440 } 
__attribute__((packed));
 
  447    enum : common::MsgType_t {
 
  453    using RejectCode_t=mit_jse::reject_codes_enum;
 
  454    using order_qty_t=
std::int32_t;
 
  490       return clientOrderID_;
 
  493       libjmmcg::memcpy_opt(clID, clientOrderID_);
 
  544 } 
__attribute__((packed));
 
  550    using RejectCode_t=mit_jse::reject_codes_enum;
 
  556 } 
__attribute__((packed));
 
  562    using RejectCode_t=mit_jse::reject_codes_enum;
 
  567 } 
__attribute__((packed));
 
  573    using RejectCode_t=mit_jse::reject_codes_enum;
 
  575    static inline constexpr const RejectCode_t 
unknown_instrument=mit_jse::reject_codes_enum::MatchingEngine_Unknown_instrument_9000;
 
  576 } 
__attribute__((packed));
 
  589    template<
class SrcMsg> 
explicit __stdcall 
  595    static inline constexpr const exchanges::common::mic_codes::ISO_10383_MIC_Codes 
MIC_code=exchanges::common::mic_codes::ISO_10383_MIC_Codes::ISO_10383_SOUTH_AFRICA_XJSE;
 
  606    using ClientOrderID_t=
common::ClientOrderID_t;
 
  619    using Logout=LogoutRequest;
 
  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();  
 
  671             boost::mpl::min_element<
 
  672                boost::mpl::transform_view<client_to_exchange_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
 
  678             boost::mpl::max_element<
 
  679                boost::mpl::transform_view<client_to_exchange_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
 
  685             boost::mpl::min_element<
 
  686                boost::mpl::transform_view<exchange_to_client_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
 
  692             boost::mpl::max_element<
 
  693                boost::mpl::transform_view<exchange_to_client_messages_t, boost::mpl::sizeof_<boost::mpl::_1> >
 
  697       min_msg_size=libjmmcg::min<std::size_t, min_size_client_to_exchange_msg, min_size_exchange_to_client_msg>::value,
 
  698       max_msg_size=libjmmcg::max<std::size_t, max_size_client_to_exchange_msg, max_size_exchange_to_client_msg>::value,
 
  701    BOOST_MPL_ASSERT_RELATION(max_msg_size, >=, header_t_size);
 
  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_t), ==, 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);