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
sequence_number_generator.hpp
1
#ifndef SEQUENCE_NUMBER_GENERATOR_HPP
2
#define SEQUENCE_NUMBER_GENERATOR_HPP
3
4
#include "lob/types/sequence_number.hpp"
5
6
namespace
lob {
7
8
/**
9
* @brief Generates process-wide monotonic sequence numbers.
10
*
11
* Sequence numbers identify accepted engine processing order and are assigned
12
* only after an incoming order passes validation and duplicate checks.
13
*/
14
class
SequenceNumberGenerator
{
15
private
:
16
static
std::uint64_t currentSequence;
17
18
public
:
19
/** Returns the next valid sequence number or throws on exhaustion. */
20
static
SequenceNumber
generate
();
21
};
22
23
}
// namespace lob
24
25
#endif
// SEQUENCE_NUMBER_GENERATOR_HPP
lob::SequenceNumberGenerator
Generates process-wide monotonic sequence numbers.
Definition
sequence_number_generator.hpp:14
lob::SequenceNumberGenerator::generate
static SequenceNumber generate()
Returns the next valid sequence number or throws on exhaustion.
Definition
sequence_number_generator.cpp:12
lob::SequenceNumber
Monotonic engine sequence used for deterministic processing order.
Definition
sequence_number.hpp:8
include
lob
matching
sequence_number_generator.hpp
Generated by
1.18.0