JayBeams  0.1
Another project to have fun coding.
modify_message.hpp
Go to the documentation of this file.
1 #ifndef jb_pitch2_modify_message_hpp
2 #define jb_pitch2_modify_message_hpp
3 
4 #include <boost/endian/buffers.hpp>
5 
6 #include <iosfwd>
7 
8 namespace jb {
9 namespace pitch2 {
10 
11 /**
12  * Represent the 'Modify' messages in the PITCH-2.X protocol.
13  *
14  * A full description of the fields can be found in the BATS PITCH-2.X
15  * specification:
16  * https://www.batstrading.com/resources/membership/BATS_MC_PITCH_Specification.pdf
17  *
18  * @tparam quantity_t the type used for the quantity field.
19  * @tparam price_t the type used for the price field.
20  */
21 template <typename quantity_t, typename price_t>
23  /// Capture the quantity_t template parameter as a trait
24  using quantity_type = quantity_t;
25 
26  /// Capture the price_t template parameter as a trait
27  using price_type = price_t;
28 
29  boost::endian::little_uint8_buf_t length;
30  boost::endian::little_uint8_buf_t message_type;
31  boost::endian::little_uint32_buf_t time_offset;
32  boost::endian::little_uint64_buf_t order_id;
35  boost::endian::little_uint8_buf_t modify_flags;
36 };
37 
38 /**
39  * Represent the 'Modify (long)' messages in the PITCH-2.X protocol.
40  *
41  * A full description of the fields can be found in the BATS PITCH-2.X
42  * specification:
43  * https://www.batstrading.com/resources/membership/BATS_MC_PITCH_Specification.pdf
44  */
46  boost::endian::little_uint32_buf_t,
47  boost::endian::little_uint64_buf_t> {
48  /// Define the messsage type
49  constexpr static int type = 0x27;
50 };
51 
52 /// Streaming operator for jb::pitch2::modify_message.
53 std::ostream& operator<<(std::ostream& os, modify_long_message const& x);
54 
55 /**
56  * Represent the 'Modify (short)' messages in the PITCH-2.X protocol.
57  *
58  * A full description of the fields can be found in the BATS PITCH-2.X
59  * specification:
60  * https://www.batstrading.com/resources/membership/BATS_MC_PITCH_Specification.pdf
61  */
63  boost::endian::little_uint16_buf_t,
64  boost::endian::little_uint16_buf_t> {
65  /// Define the messsage type
66  constexpr static int type = 0x28;
67 };
68 
69 /// Streaming operator for jb::pitch2::modify_message.
70 std::ostream& operator<<(std::ostream& os, modify_short_message const& x);
71 
72 } // namespace pitch2
73 } // namespace jb
74 
75 #endif // jb_pitch2_modify_message_hpp
std::ostream & operator<<(std::ostream &os, add_order_message const &x)
Streaming operator for jb::pitch2::add_order_message.
boost::endian::little_uint32_buf_t time_offset
boost::endian::little_uint8_buf_t modify_flags
boost::endian::little_uint16_buf_t price_type
Capture the price_t template parameter as a trait.
Represent the &#39;Modify (short)&#39; messages in the PITCH-2.X protocol.
boost::endian::little_uint8_buf_t length
boost::endian::little_uint8_buf_t message_type
Represent the &#39;Modify&#39; messages in the PITCH-2.X protocol.
boost::endian::little_uint16_buf_t quantity_type
Capture the quantity_t template parameter as a trait.
boost::endian::little_uint64_buf_t order_id
Represent the &#39;Modify (long)&#39; messages in the PITCH-2.X protocol.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7