JayBeams  0.1
Another project to have fun coding.
mwcb_breach_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_mwcb_breach_message_hpp
2 #define jb_itch5_mwcb_breach_message_hpp
3 
6 
7 namespace jb {
8 namespace itch5 {
9 
10 /**
11  * Represent the 'Breached Level' field in the 'MWCB Breach Message'.
12  */
14 
15 /**
16  * Represent a 'MWCB Breach' message in the ITCH-5.0 protocol.
17  *
18  * The Market Wide Circuit Breakers (MWCB) are a mechanism to halt
19  * trading if the market declines to such a level that some error is
20  * reasonably suspected. The mechanism defines three different
21  * levels, with different consequences at each level.
22  */
24  constexpr static int message_type = u'W';
25 
27  breached_level_t breached_level;
28 };
29 
30 /// Specialize decoder for a jb::itch5::mwcb_breach_message
31 template <bool V>
33  /// Please see the generic documentation for jb::itch5::decoder<>::r()
34  static mwcb_breach_message
35  r(std::size_t size, void const* buf, std::size_t off) {
37  x.header = decoder<V, message_header>::r(size, buf, off + 0);
38  x.breached_level = decoder<V, breached_level_t>::r(size, buf, off + 11);
39  return x;
40  }
41 };
42 
43 /// Streaming operator for jb::itch5::mwcb_breach_message.
44 std::ostream& operator<<(std::ostream& os, mwcb_breach_message const& x);
45 
46 } // namespace itch5
47 } // namespace jb
48 
49 #endif // jb_itch5_mwcb_breach_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.
char_list_field< u '1', u '2', u '3'> breached_level_t
Represent the &#39;Breached Level&#39; field in the &#39;MWCB Breach Message&#39;.
Define the interface to decode ITCH-5.0 messages and message fields.
Definition: decoder.hpp:24
static mwcb_breach_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 a &#39;MWCB Breach&#39; message in the ITCH-5.0 protocol.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7