Leka
A low-latency C++20 price-time-priority limit order book and matching engine
▶ Replay viewer
Loading...
Searching...
No Matches
lob::Quantity Class Reference

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.

Detailed Description

Type-safe unsigned order quantity; zero represents a filled state.

Definition at line 8 of file quantity.hpp.

Constructor & Destructor Documentation

◆ Quantity() [1/2]

lob::Quantity::Quantity ( )
inline

Constructs a zero quantity.

Definition at line 14 of file quantity.hpp.

Referenced by operator+(), and operator<=>().

◆ Quantity() [2/2]

lob::Quantity::Quantity ( std::uint64_t quantity)
inline

Constructs a quantity from its numeric value.

Definition at line 17 of file quantity.hpp.

Member Function Documentation

◆ getQuantity()

std::uint64_t lob::Quantity::getQuantity ( ) const
inline

◆ isValid()

bool lob::Quantity::isValid ( ) const
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().

◆ operator<=>()

auto lob::Quantity::operator<=> ( const Quantity & other) const
default

Compares quantities by numeric value.

References Quantity().

◆ operator+()

Quantity lob::Quantity::operator+ ( const Quantity & other) const
inline

Adds quantities while preserving the Quantity type.

Definition at line 30 of file quantity.hpp.

References Quantity().


The documentation for this class was generated from the following file: