|
ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
Maintains a full-market set of order books from a single pass over the feed. More...
#include <book_manager.hpp>
Public Types | |
| using | BboCallback = std::function< void(const L3Book &book, const Bbo &bbo)> |
| Invoked when a book's best bid or offer changes. | |
Public Member Functions | |
| BookManager ()=default | |
| Constructs an empty manager with no books tracked yet. | |
| auto | process (const Message &message) -> void |
| Processes one parsed ITCH message, updating the relevant book and emitting BBO/trade events as appropriate. | |
| auto | set_bbo_callback (BboCallback callback) -> void |
| Installs the best-bid/offer change callback (empty clears it). | |
| auto | set_trade_callback (TradeCallback callback) -> void |
| Installs the trade-tape callback (empty clears it). | |
| auto | track_symbol (std::string symbol) -> void |
| Restricts tracking to the given symbol (call once per symbol). | |
| auto | book (std::uint16_t stock_locate) const -> const L3Book * |
| The book for a locate code, or nullptr if none is tracked. | |
| auto | book_for_symbol (std::string_view symbol) const -> const L3Book * |
| The book for a symbol, or nullptr if none is tracked. | |
| auto | book_count () const noexcept -> std::size_t |
| The number of books currently maintained. | |
| auto | symbol_for_locate (std::uint16_t stock_locate) const -> std::string_view |
| The symbol associated with a locate code (empty if unknown). | |
Maintains a full-market set of order books from a single pass over the feed.
Every order, execution, cancel, delete, and replace message carries a stock locate code; the manager routes each message to that security's L3Book in O(1) through a flat, locate-indexed table, reconstructing every symbol on the feed at once rather than a single pre-selected one. It optionally restricts work to a chosen universe of symbols, emits best-bid/offer change events as they happen, and extracts the trade tape.
Definition at line 37 of file book_manager.hpp.
| using itch::book::BookManager::BboCallback = std::function<void(const L3Book& book, const Bbo& bbo)> |
Invoked when a book's best bid or offer changes.
Definition at line 40 of file book_manager.hpp.
|
default |
Constructs an empty manager with no books tracked yet.
| auto itch::book::BookManager::process | ( | const Message & | message | ) | -> void |
Processes one parsed ITCH message, updating the relevant book and emitting BBO/trade events as appropriate.
| message | The parsed ITCH message to apply. |
Definition at line 183 of file book_manager.cpp.
|
inline |
Installs the best-bid/offer change callback (empty clears it).
| callback | Invoked whenever a tracked book's best bid or offer changes. |
Definition at line 53 of file book_manager.hpp.
|
inline |
Installs the trade-tape callback (empty clears it).
| callback | Invoked for each trade extracted from the feed. |
Definition at line 57 of file book_manager.hpp.
|
inline |
Restricts tracking to the given symbol (call once per symbol).
When no symbol is added, every symbol on the feed is tracked.
| symbol | The ticker symbol to add to the tracked universe. |
Definition at line 64 of file book_manager.hpp.
References symbol.
| auto itch::book::BookManager::book | ( | std::uint16_t | stock_locate | ) | const -> const L3Book* |
The book for a locate code, or nullptr if none is tracked.
| stock_locate | The exchange-assigned stock locate code. |
stock_locate, or nullptr if it is not tracked. Definition at line 211 of file book_manager.cpp.
References stock_locate.
| auto itch::book::BookManager::book_for_symbol | ( | std::string_view | symbol | ) | const -> const L3Book* |
The book for a symbol, or nullptr if none is tracked.
| symbol | The ticker symbol to look up. |
symbol, or nullptr if it is not tracked. Definition at line 216 of file book_manager.cpp.
References symbol.
|
inlinenoexcept |
The number of books currently maintained.
Definition at line 80 of file book_manager.hpp.
| auto itch::book::BookManager::symbol_for_locate | ( | std::uint16_t | stock_locate | ) | const -> std::string_view |
The symbol associated with a locate code (empty if unknown).
| stock_locate | The exchange-assigned stock locate code. |
stock_locate, or an empty view if unknown. Definition at line 225 of file book_manager.cpp.
References stock_locate, and itch::book::L3Book::symbol().