BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
AuthManager.h
Go to the documentation of this file.
1
6#pragma once
7
9#include <string>
10#include <memory>
11#include <functional>
12
13namespace fix_client {
14
24 public:
25 using AuthCallback = std::function<void(bool success, const std::string& message)>;
26
27 AuthManager(std::shared_ptr<FixClientSession> session);
28
35 void authenticate(const std::string& username, const std::string& password, AuthCallback callback);
36
41 bool handleMessage(const ParsedFixMessage& parsed, const std::string& rawFix);
42
43 private:
44 std::shared_ptr<FixClientSession> mSession;
46 std::string mPendingReqId;
47 };
48
49} // namespace fix_client
Manages the FIX client-side TCP connection and protocol state machine.
A layer above FixClientSession that handles the 35=BE/BF credentials exchange.
Definition AuthManager.h:23
AuthCallback mPendingCallback
Definition AuthManager.h:45
bool handleMessage(const ParsedFixMessage &parsed, const std::string &rawFix)
Intercepts incoming messages looking for 35=BF.
Definition AuthManager.cpp:34
std::string mPendingReqId
Definition AuthManager.h:46
std::function< void(bool success, const std::string &message)> AuthCallback
Definition AuthManager.h:25
std::shared_ptr< FixClientSession > mSession
Definition AuthManager.h:44
void authenticate(const std::string &username, const std::string &password, AuthCallback callback)
Sends the 35=BE message and awaits response.
Definition AuthManager.cpp:14
Definition AuthManager.h:13
std::variant< std::monostate, fix::ExecutionReport, fix::MarketDataSnapshotFullRefresh, fix::MarketDataIncrementalRefresh > ParsedFixMessage
A variant representing the possible parsed messages received by the client.
Definition FixMessageParser.h:25