7#include "lob/book/order_pool.hpp"
8#include "lob/book/price_ladder.hpp"
9#include "lob/index/order_index.hpp"
10#include "lob/book/price_level.hpp"
180 Order* addOrderWithQuantities(
static constexpr std::size_t DefaultLevelCount
Number of representable price levels used by the default constructor.
std::size_t getBidLevelCount() const
Returns the number of occupied bid price levels.
void reserveOrderCapacity(std::size_t orderCount)
Pre-allocates order storage and index capacity for up to orderCount live orders.
PriceLevel * getBestBid()
Returns the mutable highest-priced bid level.
Order * addRestingRemainder(OrderId orderId, Price price, Quantity originalQuantity, Quantity remainingQuantity, Timestamp timestamp, OrderSide orderSide, OrderType orderType, SequenceNumber sequenceNumber)
Adds a partially filled limit order while preserving its history.
bool reduceOrder(const OrderId &orderId, Quantity newQuantity)
Shrinks a resting order in place, preserving its priority.
Order * addOrder(OrderId orderId, Price price, Quantity quantity, Timestamp timestamp, OrderSide orderSide, OrderType orderType, SequenceNumber sequenceNumber)
Adds a valid resting limit order to the appropriate side.
void captureSnapshot(BookSnapshot &out, std::size_t depth) const
Fills out with the top depth levels of each side.
std::size_t getAskLevelCount() const
Returns the number of occupied ask price levels.
OrderBook()
Creates an order book with a small default price range.
bool cancelOrder(const OrderId &orderId)
Removes a resting order by ID.
Order * findOrder(const OrderId &orderId)
Finds an order by ID, or returns nullptr when absent.
void removeOrder(Order *order)
Removes a currently resting order from every book structure.
PriceLevel * getBestAsk()
Returns the mutable lowest-priced ask level.
Type-safe identifier for an order; zero is reserved as invalid.
Open-addressed OrderId -> Order* index with average O(1) lookup.
Provides stable, pooled storage for Order objects.
Represents a resting or incoming order and its lifecycle state.
Fixed-range, tick-indexed array of PriceLevel slots for one side of a book.
Maintains FIFO resting orders at one price.
Type-safe nonzero price value used for price ordering.
Type-safe unsigned order quantity; zero represents a filled state.
Monotonic engine sequence used for deterministic processing order.
Nanoseconds since the Unix epoch; zero is reserved as invalid.
Point-in-time view of book state for consumers outside the engine.
Top-of-book depth plus the counters a viewer needs for context.