JayBeams  0.1
Another project to have fun coding.
stock_directory_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_stock_directory_message_hpp
2 #define jb_itch5_stock_directory_message_hpp
3 
7 
8 namespace jb {
9 namespace itch5 {
10 
11 /**
12  * Represent the 'Market Category' field on a 'Stock Directory' message.
13  */
14 typedef char_list_field<
15  u'Q', // NASDAQ Global Select Market
16  u'G', // NASDAQ Global Market
17  u'S', // NASDAQ Capital Market
18  u'N', // New York Stock Exchange
19  u'A', // NYSE MKT
20  u'P', // NYSE ARCA
21  u'Z', // BATS Z Exchange
22  u' ' // Not available
23  >
25 
26 /**
27  * Represent the 'Financial Status Indicator' field on a 'Stock
28  * Directory' message.
29  */
30 typedef char_list_field<
31  u'D', // Deficient
32  u'E', // Delinquent
33  u'Q', // Bankrupt
34  u'S', // Suspended
35  u'G', // Deficient and Bankrupt
36  u'H', // Deficient and Delinquent
37  u'J', // Delinquent and Bankrupt
38  u'K', // Deficient, Delinquent and Bankrupt
39  u'C', // Creations and/or Redemptions Suspended for Exchange Traded
40  // Product
41  u'N', // Nomal (Default): Issuer is not Deficient, Delinquent or Bankrupt
42  u' ' // Not available
43  >
45 
46 /**
47  * Represent the 'Round Lots Only' field on a 'Stock
48  * Directory' message.
49  */
51 
52 /**
53  * Represent the 'Issue Classification' field on a 'Stock
54  * Directory' message.
55  */
56 typedef char_list_field<
57  u'A', // American Depositary Share
58  u'B', // Bond
59  u'C', // Common Stock
60  u'F', // Depository Receipt
61  u'I', // 144A
62  u'L', // Limited Partnership
63  u'N', // Notes
64  u'O', // Ordinary Share
65  u'P', // Preferred Stock
66  u'Q', // Other Securities
67  u'R', // Right
68  u'S', // Shares of Beneficial Interest
69  u'T', // Convertible Debenture
70  u'U', // Unit
71  u'V', // Units/Benif Int
72  u'W' // Warrant
73  >
75 
76 /// A functor to validate the 'Issue Sub-Type' field.
78  /// functor operator
79  bool operator()(char const* value) const;
80 };
81 
82 /**
83  * Represent the 'Issue Sub-Type' field on a 'Stock Directory' message.
84  */
86 
87 /**
88  * Represent the 'Authenticity' field on a 'Stock
89  * Directory' message.
90  */
91 typedef char_list_field<
92  u'P', // Production
93  u'T' // Test
94  >
96 
97 /**
98  * Represent the 'Short Sale Threshold Indicator' field on a 'Stock
99  * Directory' message.
100  */
102 
103 /**
104  * Represent the 'IPO Flag' field on a 'Stock
105  * Directory' message.
106  */
108 
109 /**
110  * Represent the 'LULD Reference Price Tier' field on a 'Stock
111  * Directory' message.
112  *
113  * LULD stands for 'Limit Up, Limit Down', a restriction on pricing to
114  * avoid sudden drops or increases in price.
115  */
117 
118 /**
119  * Represent the 'ETP Flag' field on a 'Stock
120  * Directory' message.
121  */
123 
124 /**
125  * Represent the 'Inverse Indicator' field on a 'Stock
126  * Directory' message.
127  */
129 
130 /**
131  * Represent a 'Stock Directory' message in the ITCH-5.0 protocol.
132  */
134  constexpr static int message_type = u'R';
135 
141  roundlots_only_t roundlots_only;
143  issue_subtype_t issue_subtype;
145  short_sale_threshold_indicator_t short_sale_threshold_indicator;
146  ipo_flag_t ipo_flag;
147  luld_reference_price_tier_t luld_reference_price_tier;
148  etp_flag_t etp_flag;
150  inverse_indicator_t inverse_indicator;
151 };
152 
153 /// Specialize decoder for a jb::itch5::stock_directory_message
154 template <bool V>
156  /// Please see the generic documentation for jb::itch5::decoder<>::r()
158  r(std::size_t size, void const* buf, std::size_t off) {
160  x.header = decoder<V, message_header>::r(size, buf, off + 0);
161  x.stock = decoder<V, stock_t>::r(size, buf, off + 11);
162  x.market_category = decoder<V, market_category_t>::r(size, buf, off + 19);
164  decoder<V, financial_status_indicator_t>::r(size, buf, off + 20);
165  x.round_lot_size = decoder<V, std::uint32_t>::r(size, buf, off + 21);
166  x.roundlots_only = decoder<V, roundlots_only_t>::r(size, buf, off + 25);
168  decoder<V, issue_classification_t>::r(size, buf, off + 26);
169  x.issue_subtype = decoder<V, issue_subtype_t>::r(size, buf, off + 27);
170  x.authenticity = decoder<V, authenticity_t>::r(size, buf, off + 29);
173  x.ipo_flag = decoder<V, ipo_flag_t>::r(size, buf, off + 31);
175  decoder<V, luld_reference_price_tier_t>::r(size, buf, off + 32);
176  x.etp_flag = decoder<V, etp_flag_t>::r(size, buf, off + 33);
177  x.etp_leverage_factor = decoder<V, std::uint32_t>::r(size, buf, off + 34);
179  decoder<V, inverse_indicator_t>::r(size, buf, off + 38);
180  return x;
181  }
182 };
183 
184 /// Streaming operator for jb::itch5::stock_directory_message.
185 std::ostream& operator<<(std::ostream& os, stock_directory_message const& x);
186 
187 } // namespace itch5
188 } // namespace jb
189 
190 #endif // jb_itch5_stock_directory_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.
financial_status_indicator_t financial_status_indicator
char_list_field< u 'Y', u 'N'> inverse_indicator_t
Represent the &#39;Inverse Indicator&#39; field on a &#39;Stock Directory&#39; message.
char_list_field< u 'Y', u 'N'> roundlots_only_t
Represent the &#39;Round Lots Only&#39; field on a &#39;Stock Directory&#39; message.
short_sale_threshold_indicator_t short_sale_threshold_indicator
A helper type to define char fields with a limited set of values.
char_list_field< u 'A', u 'B', u 'C', u 'F', u 'I', u 'L', u 'N', u 'O', u 'P', u 'Q', u 'R', u 'S', u 'T', u 'U', u 'V', u 'W' > issue_classification_t
Represent the &#39;Issue Classification&#39; field on a &#39;Stock Directory&#39; message.
char_list_field< u 'Q', u 'G', u 'S', u 'N', u 'A', u 'P', u 'Z', u' ' > market_category_t
Represent the &#39;Market Category&#39; field on a &#39;Stock Directory&#39; message.
luld_reference_price_tier_t luld_reference_price_tier
char_list_field< u 'Y', u 'N', u' '> ipo_flag_t
Represent the &#39;IPO Flag&#39; field on a &#39;Stock Directory&#39; message.
char_list_field< u 'Y', u 'N', u' '> etp_flag_t
Represent the &#39;ETP Flag&#39; field on a &#39;Stock Directory&#39; message.
char_list_field< u 'P', u 'T' > authenticity_t
Represent the &#39;Authenticity&#39; field on a &#39;Stock Directory&#39; message.
char_list_field< u 'D', u 'E', u 'Q', u 'S', u 'G', u 'H', u 'J', u 'K', u 'C', u 'N', u' ' > financial_status_indicator_t
Represent the &#39;Financial Status Indicator&#39; field on a &#39;Stock Directory&#39; message.
Define the interface to decode ITCH-5.0 messages and message fields.
Definition: decoder.hpp:24
bool operator()(char const *value) const
functor operator
char_list_field< u 'Y', u 'N', u' '> short_sale_threshold_indicator_t
Represent the &#39;Short Sale Threshold Indicator&#39; field on a &#39;Stock Directory&#39; message.
std::ostream & operator<<(std::ostream &os, add_order_message const &x)
Streaming operator for jb::itch5::add_order_message.
A functor to validate the &#39;Issue Sub-Type&#39; field.
static stock_directory_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
short_string_field< 2, validate_issue_subtype > issue_subtype_t
Represent the &#39;Issue Sub-Type&#39; field on a &#39;Stock Directory&#39; message.
Represent a &#39;Stock Directory&#39; message in the ITCH-5.0 protocol.
char_list_field< u '1', u '2', u' '> luld_reference_price_tier_t
Represent the &#39;LULD Reference Price Tier&#39; field on a &#39;Stock Directory&#39; message.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7