|
Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
|
One session's ClOrdIDs, each mapped to the working order that holds it. More...
#include <order_gateway/cl_ord_id_index.hpp>
Public Member Functions | |
| template<typename K> | |
| uint64_t | find (const K &id) const noexcept |
| The working order named id, or 0 when no order holds it (a request may). | |
| bool | claim (const Key &id, uint64_t order_num=0) |
| Claims id for a new order (order_num 0) or for a replace of order_num. | |
| template<typename K> | |
| bool | claim (const K &id, uint64_t order_num=0) |
| The same, by the key's lookup form. | |
| template<typename K> | |
| void | release (const K &id) noexcept |
| The request that claimed id was answered. | |
| template<typename K> | |
| void | assign (const K &id, uint64_t order_num) |
| id now names order_num. | |
| template<typename K> | |
| void | forget (const K &id, uint64_t order_num) noexcept |
| order_num no longer holds id: it is done, or was renamed. | |
| template<typename K> | |
| void | rename (const K &from, const K &to, uint64_t order_num) |
| A replace renamed order_num from from to to. | |
| size_t | size () const noexcept |
| How many ids are taken - by a working order, by a request in flight, or both. | |
| bool | empty () const noexcept |
One session's ClOrdIDs, each mapped to the working order that holds it.
A new order or replace claims its ClOrdID when it is sent, so no other request can take it before the exchange answers. Replaces of one order may share a claim with each other and with that order: a ClOrdID it is renamed away from stays taken while one of them still needs it. Each claim is released once, when its request is answered. Order number 0 means none.
Definition at line 18 of file cl_ord_id_index.hpp.
|
inline |
|
inlinenodiscard |
The same, by the key's lookup form.
Building the key costs less than the second hash a find-then-insert would take, and a new claim stores it anyway.
Definition at line 41 of file cl_ord_id_index.hpp.
References claim().
|
inlinenodiscard |
Claims id for a new order (order_num 0) or for a replace of order_num.
False when another order, or a request for one, has it.
Definition at line 29 of file cl_ord_id_index.hpp.
Referenced by claim().
|
inlinenodiscardnoexcept |
Definition at line 84 of file cl_ord_id_index.hpp.
|
inlinenodiscardnoexcept |
The working order named id, or 0 when no order holds it (a request may).
Definition at line 22 of file cl_ord_id_index.hpp.
|
inlinenoexcept |
order_num no longer holds id: it is done, or was renamed.
Definition at line 68 of file cl_ord_id_index.hpp.
Referenced by rename().
|
inlinenoexcept |
The request that claimed id was answered.
Definition at line 47 of file cl_ord_id_index.hpp.
|
inline |
A replace renamed order_num from from to to.
Definition at line 77 of file cl_ord_id_index.hpp.
|
inlinenodiscardnoexcept |
How many ids are taken - by a working order, by a request in flight, or both.
Definition at line 83 of file cl_ord_id_index.hpp.