JayBeams  0.1
Another project to have fun coding.
base_add_order_message.hpp
Go to the documentation of this file.
1 #ifndef jb_pitch2_base_add_order_message_hpp
2 #define jb_pitch2_base_add_order_message_hpp
3 
4 #include <jb/fixed_string.hpp>
5 #include <boost/endian/buffers.hpp>
6 
7 namespace jb {
8 namespace pitch2 {
9 
10 /**
11  * Common type for the 'Add Order' messages in the PITCH-2.X protocol.
12  *
13  * The protocol defines 3 different 'Add Order' messages, which are
14  * largely identical except for the width of some of the fields. We
15  * use this template class to represent the common structure of these
16  * messages.
17  *
18  * @tparam quantity_t the type used for the quantity field.
19  * @tparam price_t the type used for the price field.
20  * @tparam symbol_t the type used for the symbol field.
21  */
22 template <typename quantity_t, typename symbol_t, typename price_t>
24  /// Capture the quantity_type template parameter as a trait
25  using quantity_type = quantity_t;
26 
27  /// Capture the price_type template parameter as a trait
28  using price_type = price_t;
29 
30  /// The type for the symbol field.
31  using symbol_type = symbol_t;
32 
33  boost::endian::little_uint8_buf_t length;
34  boost::endian::little_uint8_buf_t message_type;
35  boost::endian::little_uint32_buf_t time_offset;
36  boost::endian::little_uint64_buf_t order_id;
37  boost::endian::little_uint8_buf_t side_indicator;
41  boost::endian::little_uint8_buf_t add_flags;
42 };
43 
44 } // namespace pitch2
45 } // namespace jb
46 
47 #endif // jb_pitch2_base_add_order_message_hpp
Common type for the &#39;Add Order&#39; messages in the PITCH-2.X protocol.
boost::endian::little_uint32_buf_t quantity_type
Capture the quantity_type template parameter as a trait.
boost::endian::little_uint8_buf_t side_indicator
boost::endian::little_uint32_buf_t time_offset
boost::endian::little_uint8_buf_t message_type
boost::endian::little_uint8_buf_t length
boost::endian::little_uint64_buf_t order_id
boost::endian::little_uint8_buf_t add_flags
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7