JayBeams  0.1
Another project to have fun coding.
add_order_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_add_order_message_hpp
2 #define jb_itch5_add_order_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'A';
17 
19  std::uint64_t order_reference_number;
21  int shares;
24 };
25 
26 /// Specialize decoder for a jb::itch5::add_order_message
27 template <bool V>
29  /// Please see the generic documentation for jb::itch5::decoder<>::r()
30  static add_order_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);
35  decoder<V, std::uint64_t>::r(size, buf, off + 11);
37  decoder<V, buy_sell_indicator_t>::r(size, buf, off + 19);
38  x.shares = decoder<V, std::uint32_t>::r(size, buf, off + 20);
39  x.stock = decoder<V, stock_t>::r(size, buf, off + 24);
40  x.price = decoder<V, price4_t>::r(size, buf, off + 32);
41  return x;
42  }
43 };
44 
45 /// Streaming operator for jb::itch5::add_order_message.
46 std::ostream& operator<<(std::ostream& os, add_order_message const& x);
47 
48 } // namespace itch5
49 } // namespace jb
50 
51 #endif // jb_itch5_add_order_message_hpp
static constexpr int message_type
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
std::ostream & operator<<(std::ostream &os, add_order_message const &x)
Streaming operator for jb::itch5::add_order_message.
static add_order_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
buy_sell_indicator_t buy_sell_indicator
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