ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
wire.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6#include "itch/messages.hpp"
7
17
18namespace itch::detail {
19
24constexpr std::size_t TIMESTAMP_STRUCT_PADDING = sizeof(std::uint64_t) - 6;
25
27template <typename MsgType>
28constexpr std::size_t WIRE_SIZE = sizeof(MsgType) - TIMESTAMP_STRUCT_PADDING;
29
30// Lock the padding assumption to the spec lengths so a future struct change that
31// breaks the derivation is caught at compile time rather than at runtime.
32static_assert(WIRE_SIZE<SystemEventMessage> == 12);
33static_assert(WIRE_SIZE<StockDirectoryMessage> == 39);
34static_assert(WIRE_SIZE<AddOrderMessage> == 36);
35static_assert(WIRE_SIZE<NOIIMessage> == 50);
36static_assert(WIRE_SIZE<DLCRMessage> == 48);
37
47template <typename Visitor>
48constexpr auto for_each_message_type(Visitor&& visitor) -> void {
49 visitor.template operator()<SystemEventMessage>('S');
50 visitor.template operator()<StockDirectoryMessage>('R');
51 visitor.template operator()<StockTradingActionMessage>('H');
52 visitor.template operator()<RegSHOMessage>('Y');
53 visitor.template operator()<MarketParticipantPositionMessage>('L');
54 visitor.template operator()<MWCBDeclineLevelMessage>('V');
55 visitor.template operator()<MWCBStatusMessage>('W');
56 visitor.template operator()<IPOQuotingPeriodUpdateMessage>('K');
57 visitor.template operator()<LULDAuctionCollarMessage>('J');
58 visitor.template operator()<OperationalHaltMessage>('h');
59 visitor.template operator()<AddOrderMessage>('A');
60 visitor.template operator()<AddOrderMPIDAttributionMessage>('F');
61 visitor.template operator()<OrderExecutedMessage>('E');
62 visitor.template operator()<OrderExecutedWithPriceMessage>('C');
63 visitor.template operator()<OrderCancelMessage>('X');
64 visitor.template operator()<OrderDeleteMessage>('D');
65 visitor.template operator()<OrderReplaceMessage>('U');
66 visitor.template operator()<NonCrossTradeMessage>('P');
67 visitor.template operator()<CrossTradeMessage>('Q');
68 visitor.template operator()<BrokenTradeMessage>('B');
69 visitor.template operator()<NOIIMessage>('I');
70 visitor.template operator()<RetailPriceImprovementIndicatorMessage>('N');
71 visitor.template operator()<DLCRMessage>('O');
72}
73
74} // namespace itch::detail
Defines every ITCH 5.0 message struct, the Message variant, and the stream-printing helpers used to f...
constexpr std::size_t WIRE_SIZE
The exact on-wire size, in bytes, of a fully formed message of type T.
Definition wire.hpp:28
constexpr auto for_each_message_type(Visitor &&visitor) -> void
Invokes visitor.template operator()<MsgType>(type_byte) once for each ITCH 5.0 message type,...
Definition wire.hpp:48
constexpr std::size_t TIMESTAMP_STRUCT_PADDING
The on-wire ITCH timestamp is 48 bits (6 bytes), but every message struct stores it in a 64-bit field...
Definition wire.hpp:24
Add Order, With MPID Attribution (F): like Add Order, but attributed to a market participant.
Definition messages.hpp:229
Add Order, No MPID Attribution (A): a new displayable order has been accepted and placed on the book.
Definition messages.hpp:211
Broken Trade (B): a previously disseminated execution has been broken and should be removed from any ...
Definition messages.hpp:370
Cross Trade (Q): the result of a cross (opening, closing, halt/IPO cross) for a security.
Definition messages.hpp:352
Direct Listing with Capital Raise Price Discovery (O): price-discovery data for a Direct Listing with...
Definition messages.hpp:424
IPO Quoting Period Update (K): the anticipated IPO quotation release time and price for a security.
Definition messages.hpp:159
LULD Auction Collar (J): the auction collar thresholds for a security in a Limit-Up Limit-Down tradin...
Definition messages.hpp:175
MWCB Decline Level (V): the Market-Wide Circuit Breaker breach points for the day.
Definition messages.hpp:130
MWCB Status (W): notification that a Market-Wide Circuit Breaker level has been breached.
Definition messages.hpp:145
Market Participant Position (L): a market participant's (market maker's) status in a security.
Definition messages.hpp:109
Net Order Imbalance Indicator (I): the imbalance and price-discovery data disseminated during the ope...
Definition messages.hpp:385
Trade, Non-Cross (P): an execution of a non-displayable order.
Definition messages.hpp:333
Operational Halt (h): an operational halt or resumption for a security on a specific market center.
Definition messages.hpp:194
Order Cancel (X): a partial cancellation reduced the shares of a resting order.
Definition messages.hpp:285
Order Delete (D): a resting order was cancelled in its entirety and removed from the book.
Definition messages.hpp:299
Order Executed (E): a resting order was executed in whole or in part at its display price.
Definition messages.hpp:249
Order Executed With Price (C): a resting order was executed at a price different from its display pri...
Definition messages.hpp:266
Order Replace (U): a resting order was replaced with a new order at a new reference number,...
Definition messages.hpp:314
Reg SHO Short Sale Price Test Restriction (Y): the Reg SHO short-sale restriction state for a securit...
Definition messages.hpp:94
Retail Price Improvement Indicator (N): the presence of retail price improvement interest on the bid,...
Definition messages.hpp:408
Stock Directory (R): the trading and listing reference data for a security, disseminated at the start...
Definition messages.hpp:49
Stock Trading Action (H): a change in the trading status of a security (halted, paused,...
Definition messages.hpp:77
System Event (S): signals a market or data-feed handler event.
Definition messages.hpp:33