60#if defined(ONIXS_HKEX_OMDC_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_HKEX_OMDC_COMPILER_CXX_RVALUE_REFERENCES
70#if defined(ONIXS_HKEX_OMDC_COMPILER_CXX_DEFAULTED_FUNCTIONS) && ONIXS_HKEX_OMDC_COMPILER_CXX_DEFAULTED_FUNCTIONS
146 std::ostream& operator << (std::ostream& stream, const
PriceLevel& value);
153 typedef std::vector<PriceLevel>
Array;
226 virtual
bool doBestAsk (
Price& price,
Quantity& quantity) const = 0;
227 virtual
bool doBestBid (
Price& price,
Quantity& quantity) const = 0;
229 virtual UInt64 doLastMessageSeqNumApplied() const = 0;
271 return level.getPrice();
277 return (level.quantity() != 0);
283 return (l.quantity() == r.quantity() ) && (l.numberOfOrders() == r.numberOfOrders() ) && (l.getPrice() == r.getPrice() );
298 return doBestAsk (price, quantity);
303 return doBestBid (price, quantity);
308 return doInstrumentID();
314 return bids().empty() &&
asks().empty();
319 return doLastMessageSeqNumApplied();
#define ONIXS_HKEX_OMDC_NOTHROW
std::string toString() const
String presentation of the book.
virtual ~OrderBook()
Destruction interface.
std::string toFormattedString() const
Returns formatted presentation of the book.
InstrumentId instrumentId() const
Instrument Id.
bool empty() const noexcept
Indicates whether book has no bids & asks.
const PriceLevels & bids() const
Returns a set of ascending ask prices for the given security.
bool bestAsk(Price &price, Quantity &quantity) const
UInt64 lastMessageSeqNumApplied() const
Returns Last Message Seq Num Applied to the Book.
const PriceLevels & asks() const
Returns a set of descending bid prices for the given security.
bool bestBid(Price &price, Quantity &quantity) const
std::string toShortString() const
Returns brief book info.
PriceLevelCollections::Array PriceLevels
Sequence of price levels.
UInt64 OrderId
Alias for Order Id type.
const Price & getPrice(const PriceLevel &level) noexcept
Returns value of Price8.
Int32 Price
Alias for Order Id type.
std::vector< OrderInfo > OrderInfos
PriceLevelCollections::ArrayEntry PriceLevelsEntry
Iterator to access price levels with write permissions.
bool isValid(const PriceLevel &level) noexcept
Indicates whether the instance of PriceLevel is valid.
PriceLevelCollections::ArrayConstEntry PriceLevelsConstEntry
Iterator over read-only collection of price levels.
UInt32 Quantity
Alias for Quantity type.
UInt32 InstrumentId
Alias for Instrument Id type.
Miscellaneous traits for PriceLevel class.
Array::iterator ArrayEntry
Mutable entry iterator.
std::vector< PriceLevel > Array
Sequential collection of price levels.
Array::const_iterator ArrayConstEntry
Iterator for read-only access.
Encapsulates price level concept.
PriceLevel & operator=(const PriceLevel &other)
Quantity numberOfOrders() const noexcept
Total number of orders of given price.
void updateOrderId(OrderId id, Quantity quantity)
upate order by Id
std::string toString() const
Returns string representation of the instance.
const Price & getPrice() const noexcept
Price8 value.
PriceLevel()
Default initialization.
void removeOrderId(OrderId id)
remove OrderId from the list
Quantity quantity() const noexcept
Quantify for the given price.
const OrderInfos & orders() const noexcept
returns list of order IDs for the price level
void setPrice(const Price &value) noexcept
Updates price value.
void swap(PriceLevel &) noexcept
swap values
void addOrderId(OrderId id, Quantity quantity)
add OrderId to the list
PriceLevel(const PriceLevel &)
PriceLevel(const Price &price, Quantity quantity=0, Quantity numberOfOrders=0, const OrderInfos &orders=OrderInfos())
Initializes the instances according to specified attributes.