|
BetaTrader
A HFT Eco-System
|
A thread-safe, file-backed repository for FIX Sequence Numbers. More...
#include <SeqNumStore.h>

Public Member Functions | |
| SeqNumStore (const std::string &senderCompId, const std::string &directory="seq_store") | |
| Constructs a new SeqNumStore. | |
| uint32_t | getNextSenderSeqNum () const |
| Gets the next expected outgoing sequence number. | |
| uint32_t | getNextTargetSeqNum () const |
| Gets the next expected incoming sequence number. | |
| void | reset () |
| Resets the sequence numbers to 1 (e.g., on a new day or clean Logon). | |
| void | setSeqNums (uint32_t inSeq, uint32_t outSeq) |
| Sets both sequence numbers and persists them to disk. | |
Private Member Functions | |
| void | load () |
| void | save () const |
Private Attributes | |
| std::string | mFilePath |
| uint32_t | mInSeqNum = 1 |
| std::mutex | mMutex |
| uint32_t | mOutSeqNum = 1 |
A thread-safe, file-backed repository for FIX Sequence Numbers.
To prevent ResendRequest loops on startup, the client must remember its last known sequence numbers. This class saves them to disk.
| fix_client::SeqNumStore::SeqNumStore | ( | const std::string & | senderCompId, |
| const std::string & | directory = "seq_store" |
||
| ) |
Constructs a new SeqNumStore.
| senderCompId | The component ID, used to generate the filename. |
| directory | The directory to save the sequence files (defaults to local dir). |

| uint32_t fix_client::SeqNumStore::getNextSenderSeqNum | ( | ) | const |
Gets the next expected outgoing sequence number.

| uint32_t fix_client::SeqNumStore::getNextTargetSeqNum | ( | ) | const |
Gets the next expected incoming sequence number.

|
private |


| void fix_client::SeqNumStore::reset | ( | ) |
Resets the sequence numbers to 1 (e.g., on a new day or clean Logon).


|
private |

| void fix_client::SeqNumStore::setSeqNums | ( | uint32_t | inSeq, |
| uint32_t | outSeq | ||
| ) |
Sets both sequence numbers and persists them to disk.
| inSeq | The incoming sequence number (TargetSeqNum, from server). |
| outSeq | The outgoing sequence number (SenderSeqNum, from client). |


|
private |
|
private |
|
mutableprivate |
|
private |