BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
trading_core::TradingCore Class Reference

High-level manager for partitions and command dispatch. More...

#include <TradingCore.h>

Collaboration diagram for trading_core::TradingCore:
Collaboration graph

Public Types

using ExecutionReportCallback = std::function< void(const fix::ExecutionReport &)>
 

Public Member Functions

 TradingCore ()
 
 TradingCore (data::DatabaseWorker *dbWorker, bool autoInitPartitions=true)
 
virtual ~TradingCore ()
 
std::optional< common::InstrumentfindPartitionForOrder (common::OrderID orderId) const
 
const ExecutionReportCallbackgetExecutionReportCallback () const
 
MarketDataPublishergetMarketDataPublisher ()
 
std::optional< common::OrdergetOrder (common::OrderID orderId) const
 
std::optional< common::OrdergetOrderByClientOrderId (const std::string &clientOrderId) const
 
OrderIDGeneratorgetOrderIDGenerator ()
 
PartitiongetPartition (common::Instrument instrument) const
 
void setPartition (common::Instrument instrument, std::unique_ptr< Partition > partition)
 
void start ()
 
void stop ()
 
void stopAcceptingCommands ()
 
virtual void submitCommand (std::unique_ptr< Command > command) const
 
void subscribeToExecutions (ExecutionReportCallback callback)
 
void subscribeToMarketData (common::Symbol symbol, common::SessionID sessionId)
 
void unsubscribeFromMarketData (common::SessionID sessionId)
 
void unsubscribeFromMarketData (common::Symbol symbol, common::SessionID sessionId)
 
void waitAllQueuesIdle () const
 

Static Public Member Functions

static TradingCoregetInstance ()
 

Private Member Functions

void initPartitions ()
 

Private Attributes

data::DatabaseWorkermDatabaseWorker = nullptr
 
ExecutionReportCallback mExecutionReportCallback
 
MarketDataPublisher mMarketDataPublisher
 
std::unique_ptr< OrderIDGeneratormOrderIDGenerator
 
std::unique_ptr< data::DatabaseWorkermOwnedDatabaseWorker
 
std::unique_ptr< PartitionmPartitions [static_cast< int >(common::Instrument::COUNT)]
 
std::unique_ptr< TradeIDGeneratormTradeIDGenerator
 

Detailed Description

High-level manager for partitions and command dispatch.

Member Typedef Documentation

◆ ExecutionReportCallback

Constructor & Destructor Documentation

◆ TradingCore() [1/2]

trading_core::TradingCore::TradingCore ( )
Here is the call graph for this function:

◆ TradingCore() [2/2]

trading_core::TradingCore::TradingCore ( data::DatabaseWorker dbWorker,
bool  autoInitPartitions = true 
)
explicit
Here is the call graph for this function:

◆ ~TradingCore()

trading_core::TradingCore::~TradingCore ( )
virtual
Here is the call graph for this function:

Member Function Documentation

◆ findPartitionForOrder()

std::optional< common::Instrument > trading_core::TradingCore::findPartitionForOrder ( common::OrderID  orderId) const
Here is the caller graph for this function:

◆ getExecutionReportCallback()

const TradingCore::ExecutionReportCallback & trading_core::TradingCore::getExecutionReportCallback ( ) const

◆ getInstance()

TradingCore & trading_core::TradingCore::getInstance ( )
static
Here is the caller graph for this function:

◆ getMarketDataPublisher()

MarketDataPublisher & trading_core::TradingCore::getMarketDataPublisher ( )
Here is the caller graph for this function:

◆ getOrder()

std::optional< common::Order > trading_core::TradingCore::getOrder ( common::OrderID  orderId) const
Here is the call graph for this function:

◆ getOrderByClientOrderId()

std::optional< common::Order > trading_core::TradingCore::getOrderByClientOrderId ( const std::string &  clientOrderId) const

◆ getOrderIDGenerator()

OrderIDGenerator * trading_core::TradingCore::getOrderIDGenerator ( )
Here is the caller graph for this function:

◆ getPartition()

Partition * trading_core::TradingCore::getPartition ( common::Instrument  instrument) const
Here is the caller graph for this function:

◆ initPartitions()

void trading_core::TradingCore::initPartitions ( )
private
Here is the caller graph for this function:

◆ setPartition()

void trading_core::TradingCore::setPartition ( common::Instrument  instrument,
std::unique_ptr< Partition partition 
)

◆ start()

void trading_core::TradingCore::start ( )
Here is the caller graph for this function:

◆ stop()

void trading_core::TradingCore::stop ( )
Here is the caller graph for this function:

◆ stopAcceptingCommands()

void trading_core::TradingCore::stopAcceptingCommands ( )

◆ submitCommand()

void trading_core::TradingCore::submitCommand ( std::unique_ptr< Command command) const
virtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ subscribeToExecutions()

void trading_core::TradingCore::subscribeToExecutions ( ExecutionReportCallback  callback)
Here is the caller graph for this function:

◆ subscribeToMarketData()

void trading_core::TradingCore::subscribeToMarketData ( common::Symbol  symbol,
common::SessionID  sessionId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsubscribeFromMarketData() [1/2]

void trading_core::TradingCore::unsubscribeFromMarketData ( common::SessionID  sessionId)
Here is the call graph for this function:

◆ unsubscribeFromMarketData() [2/2]

void trading_core::TradingCore::unsubscribeFromMarketData ( common::Symbol  symbol,
common::SessionID  sessionId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitAllQueuesIdle()

void trading_core::TradingCore::waitAllQueuesIdle ( ) const
Here is the call graph for this function:

Member Data Documentation

◆ mDatabaseWorker

data::DatabaseWorker* trading_core::TradingCore::mDatabaseWorker = nullptr
private

◆ mExecutionReportCallback

ExecutionReportCallback trading_core::TradingCore::mExecutionReportCallback
private

◆ mMarketDataPublisher

MarketDataPublisher trading_core::TradingCore::mMarketDataPublisher
private

◆ mOrderIDGenerator

std::unique_ptr<OrderIDGenerator> trading_core::TradingCore::mOrderIDGenerator
private

◆ mOwnedDatabaseWorker

std::unique_ptr<data::DatabaseWorker> trading_core::TradingCore::mOwnedDatabaseWorker
private

◆ mPartitions

std::unique_ptr<Partition> trading_core::TradingCore::mPartitions[static_cast< int >(common::Instrument::COUNT)]
private

◆ mTradeIDGenerator

std::unique_ptr<TradeIDGenerator> trading_core::TradingCore::mTradeIDGenerator
private

The documentation for this class was generated from the following files: