JayBeams  0.1
Another project to have fun coding.
unknown_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_unknown_message_hpp
2 #define jb_itch5_unknown_message_hpp
3 
5 
6 namespace jb {
7 namespace itch5 {
8 
9 /**
10  * A simple
11  */
13 public:
14  /// Constructor from message details
16  std::uint32_t count, std::size_t offset, std::size_t len, void const* buf)
17  : count_(count)
18  , offset_(offset)
19  , len_(len)
20  , buf_(buf) {
21  }
22  unknown_message(unknown_message&&) = default;
23 
24  //@{
25  /**
26  * @name Accessors
27  */
28  std::uint32_t count() const {
29  return count_;
30  }
31  std::uint64_t offset() const {
32  return offset_;
33  }
34  std::size_t len() const {
35  return len_;
36  }
37  void const* buf() const {
38  return buf_;
39  }
40  //@}
41 
42  /// Extract the message header
43  template <bool validate>
46  len(), static_cast<char const*>(buf()), 0);
47  }
48 
49 private:
50  // Prohibit copy and assignment
51  unknown_message(unknown_message const&) = delete;
52  unknown_message& operator=(unknown_message const&) = delete;
53 
54 private:
55  std::uint32_t count_;
56  std::size_t offset_;
57  std::size_t len_;
58  void const* buf_;
59 };
60 
61 } // namespace itch5
62 } // namespace jb
63 
64 #endif // jb_itch5_unknown_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.
unknown_message & operator=(unknown_message const &)=delete
message_header decode_header() const
Extract the message header.
void const * buf() const
unknown_message(std::uint32_t count, std::size_t offset, std::size_t len, void const *buf)
Constructor from message details.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7
std::uint32_t count() const
std::uint64_t offset() const