Leka
A low-latency C++20 price-time-priority limit order book and matching engine
▶ Replay viewer
Loading...
Searching...
No Matches
execution.hpp
1// include/lob/matching/execution.hpp
2#ifndef EXECUTION_HPP
3#define EXECUTION_HPP
4
5#include "lob/types/price.hpp"
6#include "lob/types/quantity.hpp"
7#include "lob/types/order_id.hpp"
8
9namespace lob {
10/** @brief Describes one match between an incoming and resting order. */
11 class Execution {
12 private:
13 OrderId incomingOrderId;
14 OrderId restingOrderId;
15 Price executionPrice;
16 Quantity executionQuantity;
17
18 public:
19 /** Constructs an execution at the resting order's price. */
20 Execution(OrderId incomingOrderId, OrderId restingOrderId, Price executionPrice, Quantity executionQuantity);
21
22 /** Returns the incoming order ID. */
24 /** Returns the resting order ID. */
26 /** Returns the execution price. */
28 /** Returns the executed quantity. */
30 /** Returns whether all execution fields are valid. */
31 bool isValid() const;
32 };
33} // namespace lob
34#endif // EXECUTION_HPP
bool isValid() const
Returns whether all execution fields are valid.
Definition execution.cpp:26
Quantity getExecutionQuantity() const
Returns the executed quantity.
Definition execution.cpp:21
OrderId getIncomingOrderId() const
Returns the incoming order ID.
Definition execution.cpp:9
Execution(OrderId incomingOrderId, OrderId restingOrderId, Price executionPrice, Quantity executionQuantity)
Constructs an execution at the resting order's price.
Definition execution.cpp:6
OrderId getRestingOrderId() const
Returns the resting order ID.
Definition execution.cpp:13
Price getExecutionPrice() const
Returns the execution price.
Definition execution.cpp:17
Type-safe identifier for an order; zero is reserved as invalid.
Definition order_id.hpp:10
Type-safe nonzero price value used for price ordering.
Definition price.hpp:9
Type-safe unsigned order quantity; zero represents a filled state.
Definition quantity.hpp:8