BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
ExchangeManager.h
Go to the documentation of this file.
1#pragma once
2
4#include <fix/FixServer.h>
6#include <asio.hpp>
7
8#include <memory>
9#include <atomic>
10
11namespace admin {
12
18public:
19 explicit ExchangeManager(asio::io_context& ioCtx);
21
27 bool start(short port = 8088);
28
32 void stop();
33
34 bool isRunning() const { return mIsRunning; }
35
37 fix::FixServer* getServer() { return mFixServer.get(); }
38
39private:
40 asio::io_context& mIoCtx;
41 std::unique_ptr<trading_core::TradingCore> mTradingCore;
42 std::unique_ptr<fix::FixServer> mFixServer;
43 std::unique_ptr<data::SequenceRepository> mSeqRepo;
44 std::atomic<bool> mIsRunning{false};
45
46};
47
48} // namespace admin
Top-level entry point for the trading core service.
Manages the lifecycle of a local Exchange instance (TradingCore + FixServer).
Definition ExchangeManager.h:17
trading_core::TradingCore * getCore()
Definition ExchangeManager.h:36
~ExchangeManager()
Definition ExchangeManager.cpp:9
std::unique_ptr< fix::FixServer > mFixServer
Definition ExchangeManager.h:42
std::unique_ptr< data::SequenceRepository > mSeqRepo
Definition ExchangeManager.h:43
std::unique_ptr< trading_core::TradingCore > mTradingCore
Definition ExchangeManager.h:41
void stop()
Stops all exchange services.
Definition ExchangeManager.cpp:55
bool start(short port=8088)
Starts the exchange services.
Definition ExchangeManager.cpp:13
asio::io_context & mIoCtx
Definition ExchangeManager.h:40
fix::FixServer * getServer()
Definition ExchangeManager.h:37
bool isRunning() const
Definition ExchangeManager.h:34
std::atomic< bool > mIsRunning
Definition ExchangeManager.h:44
Definition FixServer.h:17
High-level manager for partitions and command dispatch.
Definition TradingCore.h:30
Definition ExchangeManager.h:11