Leka
A low-latency C++20 price-time-priority limit order book and matching engine
Replay viewer
Loading...
Searching...
No Matches
order_id_generator.hpp
1// include/lob/types/order_id_generator.hpp
2#ifndef ORDER_ID_GENERATOR_HPP
3#define ORDER_ID_GENERATOR_HPP
4
5#include "lob/types/order_id.hpp"
6
7namespace lob {
8
9/** @brief Generates monotonically increasing order identifiers. */
11 private:
12 std::uint64_t currentId{0}; // Static member variable to keep track of the current order id
13
14 public:
15 /** Returns the next valid order identifier or throws on exhaustion. */
17};
18
19} // namespace lob
20
21#endif
Generates monotonically increasing order identifiers.
OrderId generate()
Returns the next valid order identifier or throws on exhaustion.
Type-safe identifier for an order; zero is reserved as invalid.
Definition order_id.hpp:10