|
ITCHCPP 1.6.1
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
A flat, open-addressed hash map from order reference number to pool index, used for O(1) order lookup without per-order heap allocation. More...
#include <order_index.hpp>
Public Member Functions | |
| OrderIndex () | |
| Constructs an empty map with the initial table capacity pre-allocated. | |
| auto | size () const noexcept -> std::size_t |
| The number of stored keys. | |
| auto | empty () const noexcept -> bool |
| Whether the map holds no keys. | |
| auto | find (std::uint64_t key) const noexcept -> std::uint32_t |
Returns the value for key, or NPOS if absent. | |
| auto | contains (std::uint64_t key) const noexcept -> bool |
Whether key is present. | |
| auto | insert (std::uint64_t key, std::uint32_t value) -> void |
Inserts or overwrites the value for key. | |
| auto | erase (std::uint64_t key) -> void |
Removes key if present, repairing the probe chain in place. | |
| auto | clear () -> void |
| Drops all keys (retaining capacity). | |
Static Public Attributes | |
| static constexpr std::uint32_t | NPOS = 0xFFFFFFFFU |
Sentinel returned by find when a key is absent. | |
A flat, open-addressed hash map from order reference number to pool index, used for O(1) order lookup without per-order heap allocation.
std::unordered_map allocates a node on every insert and frees one on every erase, which on a feed of hundreds of millions of add/delete messages dominates the book's cost and defeats the allocation-free goal. This map stores its slots in a single contiguous vector, probes linearly (cache friendly), and uses backward-shift deletion so heavy add/cancel churn does not accumulate tombstones. It only allocates when it grows.
Definition at line 29 of file order_index.hpp.
|
inline |
Constructs an empty map with the initial table capacity pre-allocated.
Definition at line 36 of file order_index.hpp.
|
inlinenoexcept |
The number of stored keys.
Definition at line 40 of file order_index.hpp.
|
inlinenoexcept |
Whether the map holds no keys.
Definition at line 44 of file order_index.hpp.
Referenced by itch::book::L3Book::empty().
|
inlinenoexcept |
Returns the value for key, or NPOS if absent.
| key | The order reference number to look up. |
key, or NPOS if absent. Definition at line 49 of file order_index.hpp.
References NPOS.
Referenced by contains().
|
inlinenoexcept |
Whether key is present.
| key | The order reference number to check. |
key is present, false otherwise. Definition at line 63 of file order_index.hpp.
|
inline |
Inserts or overwrites the value for key.
| key | The order reference number to insert or update. |
| value | The pool index to associate with key. |
Definition at line 70 of file order_index.hpp.
|
inline |
Removes key if present, repairing the probe chain in place.
| key | The order reference number to remove. |
Definition at line 88 of file order_index.hpp.
|
inline |
Drops all keys (retaining capacity).
Definition at line 100 of file order_index.hpp.
|
staticconstexpr |
Sentinel returned by find when a key is absent.
Definition at line 32 of file order_index.hpp.
Referenced by itch::book::L3Book::add_order(), contains(), itch::book::L3Book::delete_order(), itch::book::L3Book::execute_order(), find(), itch::book::L3Book::order_price(), itch::book::L3Book::order_side(), and itch::book::L3Book::replace_order().