9 namespace tvm {
namespace xchg {
27 auto next_it = std::next(it);
29 if (!ord.post_order) {
51 head_ = q_.
orders_.front_with_idx_opt();
52 head_orig_amount_ = head_->second.amount;
54 require(!!head_, error_code::iterator_overflow);
60 require(!!head_, error_code::iterator_overflow);
69 [[maybe_unused]]
auto [idx, ord] = *head_;
75 opt<OrderInfoXchgWithIdx> head_;
76 uint128 head_orig_amount_;
Working version of orders_queue with cached head order.
Definition: orders_queue.hpp:40
void pop()
Pop front order.
Definition: orders_queue.hpp:59
bool empty() const
Is queue empty.
Definition: orders_queue.hpp:46
OrderInfoXchgWithIdx & front_with_idx()
Get queue head (front) with caching.
Definition: orders_queue.hpp:49
orders_queue_cached(orders_queue &q)
Constructor.
Definition: orders_queue.hpp:43
~orders_queue_cached()
Destructor to store the remaining head order back to queue.
Definition: orders_queue.hpp:67
Orders queue to keep orders and common state (tokens amount).
Definition: orders_queue.hpp:16
bool empty() const
Is queue empty.
Definition: orders_queue.hpp:22
uint128 all_amount_
Amount of tokens in all orders.
Definition: orders_queue.hpp:18
big_queue< OrderInfoXchg > orders_
Orders queue.
Definition: orders_queue.hpp:19
void drop_no_post_orders(process_queue_state &state, bool sell)
Drop orders without post_order flag.
Definition: orders_queue.hpp:25
Processing orders queue state for PriceXchg.
Definition: process_queue_state.hpp:17
void on_no_post_order_done(OrderInfoXchgWithIdx ord_idx, bool sell)
When we have order without post-order flag and other side queue is empty.
Definition: process_queue_state.hpp:100