|
BetaTrader
A HFT Eco-System
|
The matching engine that pairs buy and sell orders. More...
#include <Matcher.h>

Public Member Functions | |
| Matcher (TradeIDGenerator *tradeIdGenerator) | |
| Constructs a new Matcher object. | |
| virtual | ~Matcher ()=default |
| virtual std::vector< common::Trade > | match (common::Order *incomingOrder, OrderBook &orderBook) |
| Matches an incoming order against the order book. | |
Private Member Functions | |
| template<typename TMap > | |
| void | matchTable (common::Order *incomingOrder, TMap *restingMap, std::vector< common::Trade > &trades) |
| A template function to match an incoming order against a map of resting orders. | |
Private Attributes | |
| TradeIDGenerator * | mTradeIdGenerator |
| A generator for unique trade IDs. | |
The matching engine that pairs buy and sell orders.
This class is responsible for matching incoming orders against the existing orders in the order book. It generates trades when a match is found.
|
virtualdefault |
| trading_core::Matcher::Matcher | ( | TradeIDGenerator * | tradeIdGenerator | ) |
Constructs a new Matcher object.
| tradeIdGenerator | A raw pointer to the trade ID generator. |
|
virtual |
Matches an incoming order against the order book.
| incomingOrder | The order to be matched. |
| orderBook | The order book to match against. |


|
private |
A template function to match an incoming order against a map of resting orders.
| TMap | The type of the map of resting orders (BidMap or AskMap). |
| incomingOrder | The order to be matched. |
| restingMap | A raw pointer to the map of resting orders. |
| trades | A reference to a vector of trades to which any generated trades will be added. |


|
private |
A generator for unique trade IDs.