CppTrader  1.0.4.0
C++ Trader
market_handler.h
Go to the documentation of this file.
1 
9 #ifndef CPPTRADER_MATCHING_MARKET_HANDLER_H
10 #define CPPTRADER_MATCHING_MARKET_HANDLER_H
11 
12 #include "level.h"
13 #include "order.h"
14 #include "order_book.h"
15 #include "symbol.h"
16 
17 namespace CppTrader {
18 namespace Matching {
19 
21 
33 {
34  friend class MarketManager;
35 
36 public:
37  MarketHandler() = default;
38  MarketHandler(const MarketHandler&) = delete;
40  virtual ~MarketHandler() = default;
41 
44 
45 protected:
46  // Symbol handlers
47  virtual void onAddSymbol(const Symbol& symbol) {}
48  virtual void onDeleteSymbol(const Symbol& symbol) {}
49 
50  // Order book handlers
51  virtual void onAddOrderBook(const OrderBook& order_book) {}
52  virtual void onUpdateOrderBook(const OrderBook& order_book, bool top) {}
53  virtual void onDeleteOrderBook(const OrderBook& order_book) {}
54 
55  // Price level handlers
56  virtual void onAddLevel(const OrderBook& order_book, const Level& level, bool top) {}
57  virtual void onUpdateLevel(const OrderBook& order_book, const Level& level, bool top) {}
58  virtual void onDeleteLevel(const OrderBook& order_book, const Level& level, bool top) {}
59 
60  // Order handlers
61  virtual void onAddOrder(const Order& order) {}
62  virtual void onUpdateOrder(const Order& order) {}
63  virtual void onDeleteOrder(const Order& order) {}
64 
65  // Order execution handlers
66  virtual void onExecuteOrder(const Order& order, uint64_t price, uint64_t quantity) {}
67 };
68 
69 } // namespace Matching
70 } // namespace CppTrader
71 
72 #endif // CPPTRADER_MATCHING_MARKET_HANDLER_H
virtual void onUpdateOrderBook(const OrderBook &order_book, bool top)
virtual void onAddOrder(const Order &order)
virtual void onDeleteSymbol(const Symbol &symbol)
virtual void onUpdateOrder(const Order &order)
virtual void onUpdateLevel(const OrderBook &order_book, const Level &level, bool top)
virtual void onDeleteLevel(const OrderBook &order_book, const Level &level, bool top)
virtual void onDeleteOrderBook(const OrderBook &order_book)
MarketHandler & operator=(const MarketHandler &)=delete
virtual void onDeleteOrder(const Order &order)
virtual void onAddOrderBook(const OrderBook &order_book)
MarketHandler(const MarketHandler &)=delete
MarketHandler(MarketHandler &&)=delete
virtual void onAddSymbol(const Symbol &symbol)
MarketHandler & operator=(MarketHandler &&)=delete
virtual void onAddLevel(const OrderBook &order_book, const Level &level, bool top)
virtual void onExecuteOrder(const Order &order, uint64_t price, uint64_t quantity)
Price level definition.
C++ Trader project definitions.
Definition: errors.h:16
Order definition.
Order book definition.
Price level.
Definition: level.h:32
Symbol definition.