JayBeams  0.1
Another project to have fun coding.
system_event_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_system_event_message_hpp
2 #define jb_itch5_system_event_message_hpp
3 
6 
7 namespace jb {
8 namespace itch5 {
9 
10 /**
11  * @typedef event_code_t
12  *
13  * Represent the 'Event Code' field on a 'System Event Message'
14  *
15  * - O: Start of Messages
16  * - S: Start of System hours
17  * - Q: Start of Market hours
18  * - M: End of Market hours
19  * - E: End of System hours
20  * - C: End of Messages
21  */
23 
24 /**
25  * Represent a 'System Event Message' in the ITCH-5.0 protocol.
26  */
28  constexpr static int message_type = u'S';
29 
31  event_code_t event_code;
32 };
33 
34 /// Specialize decoder for a jb::itch5::system_event_message
35 template <bool validate>
36 struct decoder<validate, system_event_message> {
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<validate, message_header>::r(size, buf, off + 0);
42  x.event_code = decoder<validate, event_code_t>::r(size, buf, off + 11);
43  return x;
44  }
45 };
46 
47 /// Streaming operator for jb::itch5::system_event_message.
48 std::ostream& operator<<(std::ostream& os, system_event_message const& x);
49 
50 } // namespace itch5
51 } // namespace jb
52 
53 #endif // jb_itch5_system_event_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.
static system_event_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
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.
char_list_field< u 'O', u 'S', u 'Q', u 'M', u 'E', u 'C'> event_code_t
Represent the &#39;Event Code&#39; field on a &#39;System Event Message&#39;.
Represent a &#39;System Event Message&#39; in the ITCH-5.0 protocol.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7