ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
overlay.hpp File Reference

Zero-copy typed views over raw ITCH message frames. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <functional>
#include <span>
#include <string_view>
#include "itch/detail/wire.hpp"
#include "itch/parser.hpp"
+ Include dependency graph for overlay.hpp:

Go to the source code of this file.

Classes

class  itch::overlay::MessageView
 A zero-copy typed view over one raw ITCH frame. More...
 
class  itch::overlay::AddOrderView
 Lazy view of an Add Order (A) message. More...
 
class  itch::overlay::OrderExecutedView
 Lazy view of an Order Executed (E) message. More...
 
class  itch::overlay::OrderExecutedWithPriceView
 Lazy view of an Order Executed With Price (C) message. More...
 
class  itch::overlay::OrderCancelView
 Lazy view of an Order Cancel (X) message. More...
 
class  itch::overlay::OrderDeleteView
 Lazy view of an Order Delete (D) message. More...
 
class  itch::overlay::OrderReplaceView
 Lazy view of an Order Replace (U) message. More...
 
class  itch::overlay::NonCrossTradeView
 Lazy view of a Trade (P, non-cross) message. More...
 

Namespaces

namespace  itch
 
namespace  itch::overlay
 
namespace  itch::overlay::detail
 

Typedefs

using itch::overlay::ViewCallback = std::function< void(const MessageView &)>
 The signature for the overlay framing callback.
 

Functions

template<typename FieldType >
auto itch::overlay::detail::read_field (const std::byte *base, std::size_t offset) noexcept -> FieldType
 Reads an integral field of width sizeof(T) at offset, converting from network (big-endian) order on access.
 
auto itch::overlay::detail::read_timestamp (const std::byte *base, std::size_t offset) noexcept -> std::uint64_t
 Reads the 48-bit ITCH timestamp at offset into a 64-bit value.
 
auto itch::overlay::detail::read_stock (const std::byte *base, std::size_t offset) noexcept -> std::string_view
 Views an 8-byte fixed-width stock field as a string_view (untrimmed).
 
consteval auto itch::overlay::build_size_table () -> std::array< std::uint16_t, 256 >
 Builds the per-type expected wire-size table at compile time, mirroring the eager parser's so the overlay validates frame lengths identically.
 
auto itch::overlay::for_each_message (std::span< const std::byte > data, const ViewCallback &callback) -> std::uint64_t
 Frames a buffer and invokes callback with a zero-copy MessageView for each well-formed message.
 

Variables

constexpr std::size_t itch::overlay::detail::STOCK_LOCATE_OFFSET = 1
 
constexpr std::size_t itch::overlay::detail::TRACKING_NUMBER_OFFSET = 3
 
constexpr std::size_t itch::overlay::detail::TIMESTAMP_OFFSET = 5
 
constexpr auto itch::overlay::SIZE_TABLE = build_size_table()
 

Detailed Description

Zero-copy typed views over raw ITCH message frames.

Provides MessageView and a family of per-message-type *View subclasses that read fields lazily, converting each field from network byte order on access rather than eagerly decoding into a host-order struct. This contrasts with the eager Parser in parser.hpp, which decodes every field up front.

Author
Bertin Balouki SIMYELI

Definition in file overlay.hpp.