|
ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
A zero-copy typed view over one raw ITCH frame. More...
#include <overlay.hpp>
Inheritance diagram for itch::overlay::MessageView:Public Member Functions | |
| constexpr | MessageView () noexcept=default |
| Constructs an empty view with no underlying frame. | |
| MessageView (const std::byte *data, std::size_t size) noexcept | |
| Constructs a view over a raw ITCH message frame. | |
| auto | type () const noexcept -> char |
| The one-byte message type. | |
| auto | stock_locate () const noexcept -> std::uint16_t |
| The locate code identifying the security. | |
| auto | tracking_number () const noexcept -> std::uint16_t |
| The Nasdaq internal tracking number. | |
| auto | timestamp () const noexcept -> std::uint64_t |
| The message timestamp (nanoseconds past midnight). | |
| auto | size () const noexcept -> std::size_t |
| The raw frame size in bytes. | |
| auto | data () const noexcept -> const std::byte * |
| Pointer to the raw frame (the type byte). | |
| template<typename FieldType > | |
| auto | read (std::size_t offset) const noexcept -> FieldType |
| Reads an arbitrary integral field at a byte offset, big-endian. | |
Protected Attributes | |
| const std::byte * | m_data {nullptr} |
| std::size_t | m_size {0} |
A zero-copy typed view over one raw ITCH frame.
In contrast to the eager Parser, which decodes every field of a message into a host-order struct, an overlay view holds only a pointer to the frame in the original buffer and converts each field from network byte order lazily, on the access. For callers that touch only a few fields per message (for example a filter that reads just the stock and price), this avoids decoding the fields they never look at. The view is non-owning: it is valid only while the underlying buffer lives.
Definition at line 88 of file overlay.hpp.
|
constexprdefaultnoexcept |
Constructs an empty view with no underlying frame.
|
inlineexplicitnoexcept |
Constructs a view over a raw ITCH message frame.
| data | Pointer to the start of the frame (the type byte). |
| size | Size of the frame in bytes. |
Definition at line 97 of file overlay.hpp.
References data().
|
inlinenoexcept |
The one-byte message type.
Definition at line 102 of file overlay.hpp.
References m_data.
|
inlinenoexcept |
The locate code identifying the security.
Definition at line 108 of file overlay.hpp.
References m_data, and itch::overlay::detail::STOCK_LOCATE_OFFSET.
|
inlinenoexcept |
The Nasdaq internal tracking number.
Definition at line 114 of file overlay.hpp.
References m_data, and itch::overlay::detail::TRACKING_NUMBER_OFFSET.
|
inlinenoexcept |
The message timestamp (nanoseconds past midnight).
Definition at line 120 of file overlay.hpp.
References m_data, itch::overlay::detail::read_timestamp(), and itch::overlay::detail::TIMESTAMP_OFFSET.
|
inlinenoexcept |
The raw frame size in bytes.
Definition at line 126 of file overlay.hpp.
References m_size.
|
inlinenoexcept |
Pointer to the raw frame (the type byte).
Definition at line 130 of file overlay.hpp.
References m_data.
Referenced by MessageView().
|
inlinenoexcept |
Reads an arbitrary integral field at a byte offset, big-endian.
| FieldType | The type of the field to read. |
| offset | Byte offset of the field within the frame. |
Definition at line 139 of file overlay.hpp.
References m_data.
|
protected |
Definition at line 144 of file overlay.hpp.
Referenced by data(), read(), itch::overlay::AddOrderView::stock(), itch::overlay::NonCrossTradeView::stock(), stock_locate(), timestamp(), tracking_number(), and type().
|
protected |
Definition at line 145 of file overlay.hpp.
Referenced by size().