|
| | L2Book () noexcept=default |
| |
| void | clear () noexcept |
| |
| FASTMM_FORCE_INLINE bool | apply_level (Side side, Price price, Qty qty) noexcept |
| | Sets/updates/deletes (qty == 0) one level.
|
| |
| void | apply_snapshot (std::span< const Level > bids, std::span< const Level > asks, std::uint64_t seq, Timestamp ts) noexcept |
| |
| void | apply_delta (const BookDeltaMsg &d) noexcept |
| | Applies a BookDeltaMsg (or snapshot with kSnapshot).
|
| |
| void | set_seq (std::uint64_t s) noexcept |
| |
| void | set_last_update (Timestamp t) noexcept |
| |
| void | mark_snapshot () noexcept |
| |
| FASTMM_FORCE_INLINE Level | best_bid () const noexcept |
| |
| FASTMM_FORCE_INLINE Level | best_ask () const noexcept |
| |
| Price | mid () const noexcept |
| |
| Price | spread () const noexcept |
| |
| Level | level (Side side, std::size_t i) const noexcept |
| | i == 0 is best. Level{} if out of range.
|
| |
| std::size_t | depth (Side side) const noexcept |
| |
| std::size_t | depth () const noexcept |
| |
| Qty | qty_at_or_better (Side side, Price limit) const noexcept |
| | Total quantity on side at prices at-or-better than limit.
|
| |
| Price | price_for_qty (Side side, Qty qty) const noexcept |
| | Price of the level at which cumulative quantity from the best reaches qty; Price{} if the side is too thin.
|
| |
| template<class F > |
| void | for_each_level (Side side, F &&f) const noexcept |
| | Visits levels best-first. F(const Level&) may return bool (false stops) or void.
|
| |
| template<std::size_t N> |
| TopLevels< N > | top (Side side) const noexcept |
| |
| bool | crossed () const noexcept |
| |
| Duration | crossed_for (Timestamp now) const noexcept |
| | How long the book has been crossed as of now (zero if not crossed).
|
| |
| bool | truncated (Side side) const noexcept |
| |
| bool | truncated () const noexcept |
| |
| bool | has_snapshot () const noexcept |
| |
| bool | is_valid () const noexcept |
| |
| std::uint64_t | seq () const noexcept |
| |
| Timestamp | last_update () const noexcept |
| |
| const StaticVector< Level, kMaxDepth > & | raw (Side side) const noexcept |
| | Raw access (worst..best order) for tests/tools.
|
| |
template<std::size_t kMaxDepth = 256>
Sets/updates/deletes (qty == 0) one level.
Returns false if the level was dropped because the side is full and the price is worse than everything stored.
Position such that v[i].price is the first level at-or-better than price when scanning from the worst (front) - i.e. lower_bound in "goodness" order.
Linear scan from the best (back) over the top kLinearScan levels.
< insert after v[i-1]
Bisect the remainder [0, stop): find first index whose price is at-or-better.
< delete of an unknown level: no-op
< worse than everything we hold
< drop the worst level to make room