JayBeams  0.1
Another project to have fun coding.
stock_trading_action_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_stock_trading_action_message_hpp
2 #define jb_itch5_stock_trading_action_message_hpp
3 
7 
8 namespace jb {
9 namespace itch5 {
10 
11 /**
12  * Represent the 'Trading State' field on a 'Stock Trading Action' message.
13  */
15 
16 /**
17  * Represent the 'Reason' field in a 'Stock Trading Action' message.
18  */
20 
21 /**
22  * Represent a 'Stock Trading Action' message in the ITCH-5.0 protocol.
23  */
25  constexpr static int message_type = u'H';
26 
29  trading_state_t trading_state;
30  int reserved;
31  reason_t reason;
32 };
33 
34 /// Specialize decoder for a jb::itch5::stock_trading_action_message
35 template <bool V>
37  /// Please see the generic documentation for jb::itch5::decoder<>::r()
39  r(std::size_t size, void const* buf, std::size_t off) {
41  x.header = decoder<V, message_header>::r(size, buf, off + 0);
42  x.stock = decoder<V, stock_t>::r(size, buf, off + 11);
43  x.trading_state = decoder<V, trading_state_t>::r(size, buf, off + 19);
44  x.reserved = decoder<V, std::uint8_t>::r(size, buf, off + 20);
45  x.reason = decoder<V, reason_t>::r(size, buf, off + 21);
46  return x;
47  }
48 };
49 
50 /// Streaming operator for jb::itch5::stock_trading_action_message.
51 std::ostream&
52 operator<<(std::ostream& os, stock_trading_action_message const& x);
53 
54 } // namespace itch5
55 } // namespace jb
56 
57 #endif // jb_itch5_stock_trading_action_message_hpp
Define the header common to all ITCH 5.0 messages.
static stock_trading_action_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
static T r(std::size_t size, void const *msg, std::size_t offset)
Read a single message or field.
char_list_field< u 'H', u 'P', u 'Q', u 'T'> trading_state_t
Represent the &#39;Trading State&#39; field on a &#39;Stock Trading Action&#39; message.
short_string_field< 4 > reason_t
Represent the &#39;Reason&#39; field in a &#39;Stock Trading Action&#39; message.
Represent a &#39;Stock Trading Action&#39; message in the ITCH-5.0 protocol.
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.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7