Skip to content
Daniel Esambu
Work
Work
Projects
Things I've built
Leka
A C++20 matching engine
Latency Lab
(opens in a new tab)
A C++ course I wrote
Resume
The formal version
Writing
Writing
Poetry
Poems, shelved by what they're about
Essays
Notes and essays
Math
Math
Notes
Notes I've written up
IB papers
Worked exam questions
Calculus lessons
(opens in a new tab)
On YouTube
Life
Life
Photos
Things I stopped to look at
Training
Reps, not phases
Modeling
Measurements and photos
Resume
Say hi
Say hi
Resume
Menu
Leka
A low-latency C++20 price-time-priority limit order book and matching engine
Replay viewer
Toggle main menu visibility
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
9
namespace
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. */
23
OrderId
getIncomingOrderId
()
const
;
24
/** Returns the resting order ID. */
25
OrderId
getRestingOrderId
()
const
;
26
/** Returns the execution price. */
27
Price
getExecutionPrice
()
const
;
28
/** Returns the executed quantity. */
29
Quantity
getExecutionQuantity
()
const
;
30
/** Returns whether all execution fields are valid. */
31
bool
isValid
()
const
;
32
};
33
}
// namespace lob
34
#endif
// EXECUTION_HPP
lob::Execution::isValid
bool isValid() const
Returns whether all execution fields are valid.
Definition
execution.cpp:26
lob::Execution::getExecutionQuantity
Quantity getExecutionQuantity() const
Returns the executed quantity.
Definition
execution.cpp:21
lob::Execution::getIncomingOrderId
OrderId getIncomingOrderId() const
Returns the incoming order ID.
Definition
execution.cpp:9
lob::Execution::Execution
Execution(OrderId incomingOrderId, OrderId restingOrderId, Price executionPrice, Quantity executionQuantity)
Constructs an execution at the resting order's price.
Definition
execution.cpp:6
lob::Execution::getRestingOrderId
OrderId getRestingOrderId() const
Returns the resting order ID.
Definition
execution.cpp:13
lob::Execution::getExecutionPrice
Price getExecutionPrice() const
Returns the execution price.
Definition
execution.cpp:17
lob::OrderId
Type-safe identifier for an order; zero is reserved as invalid.
Definition
order_id.hpp:10
lob::Price
Type-safe nonzero price value used for price ordering.
Definition
price.hpp:9
lob::Quantity
Type-safe unsigned order quantity; zero represents a filled state.
Definition
quantity.hpp:8
include
lob
matching
execution.hpp
Generated by
1.18.0