BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
Matcher.h
Go to the documentation of this file.
1//
2// Created by sujal on 23-10-2025.
3//
4
5#pragma once
6#include "OrderBook.h"
7#include "TradeIDGenerator.h"
8#include "common/Trade.h"
11#include <memory>
12#include <vector>
13
14namespace trading_core {
23 class Matcher {
24 public:
25 virtual ~Matcher() = default;
26
31 Matcher(TradeIDGenerator* tradeIdGenerator);
32
39 virtual std::vector<common::Trade> match(common::Order* incomingOrder,
40 OrderBook& orderBook);
41
42 private:
53 template<typename TMap>
54 void matchTable(common::Order* incomingOrder, TMap* restingMap,
55 std::vector<common::Trade>& trades);
56
57 private:
60 };
61} // namespace trading_core
Asynchronous database worker abstraction.
Repository interface for persisting trades.
Represents a single trading order in the system.
Definition Order.h:19
The matching engine that pairs buy and sell orders.
Definition Matcher.h:23
virtual ~Matcher()=default
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.
Definition Matcher.cpp:44
TradeIDGenerator * mTradeIdGenerator
A generator for unique trade IDs.
Definition Matcher.h:59
virtual std::vector< common::Trade > match(common::Order *incomingOrder, OrderBook &orderBook)
Matches an incoming order against the order book.
Definition Matcher.cpp:15
Represents the order book for a single financial instrument.
Definition OrderBook.h:22
A thread-safe, database-aware generator for unique trade IDs.
Definition TradeIDGenerator.h:15
Definition CancelOrder.h:10