|
Leka
A low-latency C++20 price-time-priority limit order book and matching engine
|
Type-safe unsigned order quantity; zero represents a filled state. More...
#include <quantity.hpp>
Public Member Functions | |
| Quantity () | |
| Constructs a zero quantity. | |
| Quantity (std::uint64_t quantity) | |
| Constructs a quantity from its numeric value. | |
| std::uint64_t | getQuantity () const |
| Returns the underlying numeric quantity. | |
| bool | isValid () const |
| Returns whether the quantity is valid for a submitted order. | |
| auto | operator<=> (const Quantity &other) const =default |
| Compares quantities by numeric value. | |
| Quantity | operator+ (const Quantity &other) const |
| Adds quantities while preserving the Quantity type. | |
Type-safe unsigned order quantity; zero represents a filled state.
Definition at line 8 of file quantity.hpp.
|
inline |
Constructs a zero quantity.
Definition at line 14 of file quantity.hpp.
Referenced by operator+(), and operator<=>().
|
inline |
Constructs a quantity from its numeric value.
Definition at line 17 of file quantity.hpp.
|
inline |
Returns the underlying numeric quantity.
Definition at line 20 of file quantity.hpp.
Referenced by lob::PriceLevel::addOrder(), lob::OrderBook::captureSnapshot(), lob::Order::isFullyFilled(), lob::OrderBook::reduceOrder(), lob::Order::reduceRemainingQuantity(), lob::PriceLevel::reduceTotalQuantity(), and lob::PriceLevel::removeOrder().
|
inline |
Returns whether the quantity is valid for a submitted order.
Definition at line 23 of file quantity.hpp.
Referenced by lob::Execution::isValid(), and lob::Order::setRemainingQuantity().
|
default |
Compares quantities by numeric value.
References Quantity().
Adds quantities while preserving the Quantity type.
Definition at line 30 of file quantity.hpp.
References Quantity().