JayBeams  0.1
Another project to have fun coding.
market_participant_position_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_market_participant_position_message_hpp
2 #define jb_itch5_market_participant_position_message_hpp
3 
8 
9 namespace jb {
10 namespace itch5 {
11 
12 /**
13  * Represent the 'Primary Market Maker' field on a 'Market Participant
14  * Position' message.
15  */
17 
18 /**
19  * Represent the 'Market Maker Mode' field in a 'Market Participant
20  * Position' message.
21  */
22 typedef char_list_field<
23  u'N', // Normal
24  u'P', // Passive
25  u'S', // Syndicate
26  u'R', // Pre-syndicate
27  u'L' // Penalty
28  >
30 
31 /**
32  * Represent the 'Market Participant State' field in a 'Market Participant
33  * Position' message.
34  */
35 typedef char_list_field<
36  u'A', // Active
37  u'E', // Excused/Withdrawn
38  u'W', // Withdrawn
39  u'S', // Suspended
40  u'D' // Deleted
41  >
43 
44 /**
45  * Represent a 'Market Participant Position' message in the ITCH-5.0 protocol.
46  */
48  constexpr static int message_type = u'L';
49 
53  primary_market_maker_t primary_market_maker;
56 };
57 
58 /// Specialize decoder for a jb::itch5::market_participant_position_message
59 template <bool V>
61  /// Please see the generic documentation for jb::itch5::decoder<>::r()
63  r(std::size_t size, void const* buf, std::size_t off) {
65  x.header = decoder<V, message_header>::r(size, buf, off + 0);
66  x.mpid = decoder<V, mpid_t>::r(size, buf, off + 11);
67  x.stock = decoder<V, stock_t>::r(size, buf, off + 15);
69  decoder<V, primary_market_maker_t>::r(size, buf, off + 23);
71  decoder<V, market_maker_mode_t>::r(size, buf, off + 24);
73  decoder<V, market_participant_state_t>::r(size, buf, off + 25);
74  return x;
75  }
76 };
77 
78 /// Streaming operator for jb::itch5::market_participant_position_message.
79 std::ostream&
80 operator<<(std::ostream& os, market_participant_position_message const& x);
81 
82 } // namespace itch5
83 } // namespace jb
84 
85 #endif // jb_itch5_market_participant_position_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 'A', u 'E', u 'W', u 'S', u 'D' > market_participant_state_t
Represent the &#39;Market Participant State&#39; field in a &#39;Market Participant Position&#39; message...
char_list_field< u 'Y', u 'N'> primary_market_maker_t
Represent the &#39;Primary Market Maker&#39; field on a &#39;Market Participant Position&#39; message.
Represent a &#39;Market Participant Position&#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.
static market_participant_position_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
char_list_field< u 'N', u 'P', u 'S', u 'R', u 'L' > market_maker_mode_t
Represent the &#39;Market Maker Mode&#39; field in a &#39;Market Participant Position&#39; message.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7