Skip to content
Daniel Esambu
Work
Work
Projects
Things I've built
Leka
A C++20 matching engine
Latency Lab
(opens in a new tab)
A C++ course I wrote
Resume
The formal version
Writing
Writing
Poetry
Poems, shelved by what they're about
Essays
Notes and essays
Math
Math
Notes
Notes I've written up
IB papers
Worked exam questions
Calculus lessons
(opens in a new tab)
On YouTube
Life
Life
Photos
Things I stopped to look at
Training
Reps, not phases
Modeling
Measurements and photos
Resume
Say hi
Say hi
Resume
Menu
Leka
A low-latency C++20 price-time-priority limit order book and matching engine
Replay viewer
Toggle main menu visibility
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
7
namespace
lob {
8
9
/** @brief Generates monotonically increasing order identifiers. */
10
class
OrderIdGenerator
{
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. */
16
OrderId
generate
();
17
};
18
19
}
// namespace lob
20
21
#endif
lob::OrderIdGenerator
Generates monotonically increasing order identifiers.
Definition
order_id_generator.hpp:10
lob::OrderIdGenerator::generate
OrderId generate()
Returns the next valid order identifier or throws on exhaustion.
Definition
order_id_generator.cpp:10
lob::OrderId
Type-safe identifier for an order; zero is reserved as invalid.
Definition
order_id.hpp:10
include
lob
types
order_id_generator.hpp
Generated by
1.18.0