libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT > Class Template Referencefinal

A simple, MIT-protocol exchange simulator. More...

#include <processing_rules.hpp>

Inheritance diagram for isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >:
[legend]
Collaboration diagram for isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >:
[legend]

Classes

struct  state_machine_t
 

Public Types

using base_t = exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
 
using msg_details_t = typename base_t::msg_details_t
 
using socket_t = typename base_t::socket_t
 
- Public Types inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
using base_t = message_responses< SrcMsgDetails, SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, typename SrcMsgDetails ::client_to_exchange_messages_t, SktT >
 
using msg_details_t = typename base_t::src_msg_details_t
 
using src_msg_details_t = msg_details_t
 
using socket_t = typename base_t::socket_t
 
using derived_t = typename base_t::derived_t
 
using Price_t = typename std::conditional< std::is_integral< typename msg_details_t::Price_t >::value, typename msg_details_t::Price_t, std::uint64_t >::type
 
- Public Types inherited from isimud::exchanges::common::message_responses< SrcMsgDetails, SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SrcMsgDetails ::client_to_exchange_messages_t, SktT >
using src_msg_details_t = SrcMsgDetails
 A type containing the details of the messages that will be received from the client. More...
 
using dest_msg_details_t = SrcMsgDetails
 A type containing the details of the messages that will be sent to the exchange. More...
 
using derived_t = simulator_responses< SrcMsgDetails, SktT >
 
using flow_msg_types = SrcMsgDetails ::client_to_exchange_messages_t
 
using socket_t = SktT
 

Public Member Functions

 simulator_responses () noexcept(true)
 
constexpr simulator_responses (simulator_responses const &sr) noexcept(true)
 
bool process_msg (typename msg_details_t::msg_buffer_t const &buff, socket_t &exchg_skt, socket_t &client_skt) override
 
std::string to_string () const noexcept(false)
 
- Public Member Functions inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
virtual bool process_msg (typename src_msg_details_t::msg_buffer_t const &buff, socket_t &exchg_skt, socket_t &client_skt) override=0
 
std::string to_string () const noexcept(false)
 

Static Public Attributes

static constexpr Reason_t logout_reason {"snafu\0"}
 
static constexpr msg_details_t::SecurityID_t instrumentID =133215
 The only valid instrument, all others will be rejected. More...
 
static constexpr msg_details_t::SecurityID_t invalidInstrumentID =1
 An invalid instrument, that will be rejected. More...
 
static constexpr std::chrono::seconds logout_timeout {3}
 
- Static Public Attributes inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
static constexpr msg_details_t::UserName_t username
 The only valid username. More...
 
static constexpr msg_details_t::Password_t password
 The only valid password. More...
 
static constexpr msg_details_t::Password_t new_password
 The only valid new password. More...
 
static constexpr std::int32_t quantity_limit
 The magic quantity value. More...
 
static constexpr Price_t price
 For limit orders, this is the price at which the order will be traded, otherwise it will be left "on the market". More...
 
static constexpr Price_t scaled_price
 For limit orders, this is the native, scaled price at which the order will be traded, otherwise it will be left "on the market", which is used within the simulator. More...
 

Additional Inherited Members

- Protected Types inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
using order_book_t = std::map< typename msg_details_t::ClientOrderID_t, typename msg_details_t::NewOrder >
 
- Protected Member Functions inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
 simulator_responses ()=default
 
 simulator_responses (simulator_responses const &)=default
 
- Protected Attributes inherited from isimud::exchanges::common::simulator_responses< SrcMsgDetails, simulator_responses< SrcMsgDetails, SktT >, SktT >
order_book_t order_book
 
std::int32_t sequenceNumber
 

Detailed Description

template<class SrcMsgDetails, class SktT>
class isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >

A simple, MIT-protocol exchange simulator.

The behaviour of this simulator is a simplification derived from the specification in [1]. [1] "MIT203 - MILLENNIUM EXCHANGE Native Trading Gateway"

Definition at line 187 of file processing_rules.hpp.

Member Typedef Documentation

◆ base_t

template<class SrcMsgDetails , class SktT >
using isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::base_t = exchanges::common::simulator_responses<SrcMsgDetails, simulator_responses<SrcMsgDetails, SktT>, SktT>

Definition at line 189 of file processing_rules.hpp.

◆ msg_details_t

template<class SrcMsgDetails , class SktT >
using isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::msg_details_t = typename base_t::msg_details_t

Definition at line 190 of file processing_rules.hpp.

◆ socket_t

template<class SrcMsgDetails , class SktT >
using isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::socket_t = typename base_t::socket_t

Definition at line 191 of file processing_rules.hpp.

Constructor & Destructor Documentation

◆ simulator_responses() [1/2]

template<class SrcMsgDetails , class SktT >
isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::simulator_responses ( )
inlinenoexcept

Definition at line 200 of file processing_rules.hpp.

◆ simulator_responses() [2/2]

template<class SrcMsgDetails , class SktT >
constexpr isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::simulator_responses ( simulator_responses< SrcMsgDetails, SktT > const &  sr)
inlineconstexprnoexcept

Definition at line 203 of file processing_rules.hpp.

Member Function Documentation

◆ process_msg()

template<class SrcMsgDetails , class SktT >
bool isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::process_msg ( typename msg_details_t::msg_buffer_t const &  buff,
socket_t exchg_skt,
socket_t client_skt 
)
inlineoverride
Returns
False to continue processing messages, true otherwise.

Definition at line 573 of file processing_rules_impl.hpp.

◆ to_string()

template<class SrcMsgDetails , class SktT >
std::string isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::to_string ( ) const
inlinenoexcept

Definition at line 581 of file processing_rules_impl.hpp.

Member Data Documentation

◆ instrumentID

template<class SrcMsgDetails , class SktT >
constexpr msg_details_t::SecurityID_t isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::instrumentID =133215
inlinestaticconstexpr

The only valid instrument, all others will be rejected.

VODAFONE.

Definition at line 195 of file processing_rules.hpp.

◆ invalidInstrumentID

template<class SrcMsgDetails , class SktT >
constexpr msg_details_t::SecurityID_t isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::invalidInstrumentID =1
inlinestaticconstexpr

An invalid instrument, that will be rejected.

Definition at line 197 of file processing_rules.hpp.

◆ logout_reason

template<class SrcMsgDetails , class SktT >
constexpr Reason_t isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::logout_reason {"snafu\0"}
inlinestaticconstexpr

Definition at line 193 of file processing_rules.hpp.

◆ logout_timeout

template<class SrcMsgDetails , class SktT >
constexpr std::chrono::seconds isimud::exchanges::MIT::common::simulator_responses< SrcMsgDetails, SktT >::logout_timeout {3}
inlinestaticconstexpr

Definition at line 198 of file processing_rules.hpp.


The documentation for this class was generated from the following files: