25#ifdef ONIXS_B3_UMDF_MD_CXX20
167bool operator==(
const Order& l,
const Order& r)
noexcept;
176 class InstrumentRepository;
205 std::swap(storage_, other.storage_);
206 std::swap(pos_, other.pos_);
212 return storage_ !=
nullptr;
220 return *dereference();
228 return dereference();
236 return *dereference(n);
263 return {storage_, pos_ + v};
299 return {storage_, pos_ - v};
325 assert(l.storage_ == r.storage_);
327 return l.pos_ == r.pos_;
335 assert(l.storage_ == r.storage_);
337 return l.pos_ != r.pos_;
340#ifdef ONIXS_B3_UMDF_MD_CXX20
346 assert(l.storage_ == r.storage_);
349 return std::strong_ordering::less;
352 return std::strong_ordering::greater;
354 return std::strong_ordering::equal;
363 assert(l.storage_ == r.storage_);
365 return l.pos_ - r.pos_;
376 ONIXS_B3_UMDF_MD_API pointer dereference(difference_type n = 0) const noexcept;
380 Implementation::OrdersIterator pos_{};
386 :
public std::ranges::view_interface<ConstOrdersRange>
408 return {storage_, begin_};
415 return {storage_, end_};
422 return begin_ == end_;
429 return static_cast<size_t>(std::distance(begin_, end_));
436 assert(idx <
size());
437 return begin().operator[](idx);
446 return storage_ !=
nullptr;
459 Implementation::OrdersIterator end_{};
460 const Implementation::OrderStorage* storage_{};
526 return (l.orderId() == r.orderId()) && (l.price().mantissa() == r.price().mantissa()) && (l.quantity() == r.quantity());
587 const Order* previous_;
588 const Order* current_;
593#ifdef ONIXS_B3_UMDF_MD_CXX20
594namespace std::ranges {
template <>
inline constexpr bool enable_borrowed_range<OnixS::B3::MarketData::UMDF::ConstOrdersRange> =
true; }
#define ONIXS_B3_UMDF_MD_NAMESPACE_END
#define ONIXS_B3_UMDF_MD_NAMESPACE_BEGIN
#define ONIXS_B3_UMDF_MD_CXX20
const Order * previous() const noexcept
BookAtomicChangeAction::Enum action() const noexcept
Messaging::Side::Enum side() const noexcept
constexpr BookAtomicChange(Messaging::Side::Enum side, BookAtomicChangeAction::Enum action, const Order *previous, const Order *current) noexcept
const Order * current() const noexcept
size_t size() const noexcept
Returns the number of orders in the range.
bool empty() const noexcept
Indicates whether the range contains no orders.
OrdersIterator cend() const noexcept
Returns a const iterator to one past the last order.
const Order & operator[](size_t idx) const noexcept
Returns the order at the given zero-based index.
OrdersIterator end() const noexcept
Returns an iterator to one past the last order.
bool valid() const noexcept
Indicates whether the range is bound to storage.
ConstOrdersRange() noexcept=default
Creates an empty, invalid range.
OrdersIterator begin() const noexcept
Returns an iterator to the first order.
OrdersIterator cbegin() const noexcept
Returns a const iterator to the first order.
A shared memory pool for building order books.
friend struct OrderBookPoolHelper
friend struct TestOrdBookPoolCreator
const Statistic & statistic() const noexcept
OrderBookPool(const OrderBookPoolSettings &)
std::string toString() const
String presentation of the book.
std::string toFormattedString() const
Returns formatted presentation of the book.
bool empty() const noexcept
Indicates whether book has no bids & asks.
ConstOrdersRange asks() const noexcept
Returns a set of descending ask prices for the given security.
const Implementation::InstrumentRepository *const instrumentRepository_
OrderBook(const OrderBook &)=delete
ConstOrdersRange bids() const noexcept
Returns a set of ascending bid prices for the given security.
std::string toShortString() const
Returns brief book info.
STL-like iterator over the OrderBook levels.
friend bool operator==(const OrdersIterator &l, const OrdersIterator &r) noexcept
Compares two iterators for equality.
friend bool operator!=(const OrdersIterator &l, const OrdersIterator &r) noexcept
Compares two iterators for inequality.
OrdersIterator operator++(int) noexcept
Returns a copy of the iterator before incrementing it.
OrdersIterator & operator+=(difference_type v) noexcept
Advances the iterator by the given offset.
OrdersIterator operator--(int) noexcept
Returns a copy of the iterator before decrementing it.
void swap(OrdersIterator &other) noexcept
Exchanges the iterator state with another one.
friend OrdersIterator operator+(difference_type v, OrdersIterator it) noexcept
Returns an iterator advanced by the given offset.
OrdersIterator & operator--() noexcept
Moves the iterator to the previous order.
reference operator*() const noexcept
Returns the current element.
OrdersIterator operator-(difference_type v) const noexcept
Returns an iterator moved backward by the given offset.
std::random_access_iterator_tag iterator_category
OrdersIterator & operator++() noexcept
Advances the iterator to the next order.
std::random_access_iterator_tag iterator_concept
bool valid() const noexcept
Indicates whether the iterator is valid.
friend class ConstOrdersRange
OrdersIterator operator+(difference_type v) const noexcept
Returns an iterator advanced by the given offset.
pointer operator->() const noexcept
Returns a pointer to the current element.
OrdersIterator() noexcept=default
Creates an empty iterator.
friend std::strong_ordering operator<=>(const OrdersIterator &l, const OrdersIterator &r) noexcept
Compares two iterators using three-way ordering.
friend OrdersIterator::difference_type operator-(const OrdersIterator &l, const OrdersIterator &r) noexcept
Returns the distance between two iterators.
ptrdiff_t difference_type
OrdersIterator & operator-=(difference_type v) noexcept
Moves the iterator backward by the given offset.
const BookOrderId * OrdersIterator
NullableFixedPointDecimal< Int64, IntegralConstant< Int8, -4 >, IntegralConstant< Int64, -9223372036854775807LL-1 > > PriceOptional
Optional price (4 decimal places).
Messaging::PriceOptional Price
Alias for Price type (4 decimal places)
UInt64 InstrumentId
Alias for Instrument Id type.
UInt64 OrderId
Alias for Order Id type.
bool operator==(const TimeSpan &left, const TimeSpan &right)
Compares with other instance for equality.
ONIXS_B3_UMDF_MD_API std::ostream & operator<<(std::ostream &stream, const LoggerSettings &settings)
Int64 Quantity
Alias for Quantity type.
ONIXS_B3_UMDF_MD_API void validate(const OrderBook &)
For testing only.
Enum
Types of Market Data update action.
@ Change
Change the order..
@ Clean
Clean the given book side.
@ Delete
Delete the order.
Settings for the OrderBookPool.
size_t chunkLength
Length of a chunk.
GrowthPolicy growthPolicy
size_t chunksAmount
Amount of memory chunks.
bool preferHugePage
Use Huge pages for chunk allocation.
size_t orderBooksAmount
Amount of order book objects.
int64_t maxChunksCountInUse_
std::string toString() const
Returns string representation of the instance.
Quantity quantity() const noexcept
Quantity.
OrderId orderId() const noexcept
Order Id.
ONIXS_B3_UMDF_MD_API void toString(std::string &) const
Appends representation of the instance to the string.
bool marketOrder() const
Indicates whether the order is the market order.
Price price() const noexcept
Price.
Order(OrderId orderId, Price price, Quantity quantity) noexcept
Initializes the instances according to specified attributes.