JayBeams  0.1
Another project to have fun coding.
cross_trade_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_cross_trade_message_hpp
2 #define jb_itch5_cross_trade_message_hpp
3 
8 
9 namespace jb {
10 namespace itch5 {
11 
12 /**
13  * Represent an 'Add Order' message in the ITCH-5.0 protocol.
14  */
16  constexpr static int message_type = u'Q';
17 
19  std::uint64_t shares;
22  std::uint64_t match_number;
24 };
25 
26 /// Specialize decoder for a jb::itch5::cross_trade_message
27 template <bool V>
29  /// Please see the generic documentation for jb::itch5::decoder<>::r()
30  static cross_trade_message
31  r(std::size_t size, void const* buf, std::size_t off) {
33  x.header = decoder<V, message_header>::r(size, buf, off + 0);
34  x.shares = decoder<V, std::uint64_t>::r(size, buf, off + 11);
35  x.stock = decoder<V, stock_t>::r(size, buf, off + 19);
36  x.cross_price = decoder<V, price4_t>::r(size, buf, off + 27);
37  x.match_number = decoder<V, std::uint64_t>::r(size, buf, off + 31);
38  x.cross_type = decoder<V, cross_type_t>::r(size, buf, off + 39);
39  return x;
40  }
41 };
42 
43 /// Streaming operator for jb::itch5::cross_trade_message.
44 std::ostream& operator<<(std::ostream& os, cross_trade_message const& x);
45 
46 } // namespace itch5
47 } // namespace jb
48 
49 #endif // jb_itch5_cross_trade_message_hpp
Define the header common to all ITCH 5.0 messages.
static T r(std::size_t size, void const *msg, std::size_t offset)
Read a single message or field.
Define the interface to decode ITCH-5.0 messages and message fields.
Definition: decoder.hpp:24
static cross_trade_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
std::ostream & operator<<(std::ostream &os, add_order_message const &x)
Streaming operator for jb::itch5::add_order_message.
Represent an &#39;Add Order&#39; message in the ITCH-5.0 protocol.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7