Adding incremental book updates to IMarketDataListener
This commit is contained in:
1 parent
5cf7eacd82
commit
fd0fb1f760
1 file changed
+11
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
#include "lib/api/services/OrderService.pb.h"
|
||||
#include "lib/domain/Book.h"
|
||||
#include "lib/md/PriceSize.h"
|
||||
#include <vector>
|
||||
|
||||
namespace bts::domain {
|
||||
@@ -17,6 +19,14 @@ class MarketDataError;
|
||||
// The is the interface that registers itself to IMarketDataGateway and receives
|
||||
// all market data via callbacks. These callbacks are always on the same thread.
|
||||
class IMarketDataListener {
|
||||
enum BookOpType { Add = 0, REMOVE, MODIFY };
|
||||
struct BookOp {
|
||||
bts::api::Side side;
|
||||
BookOpType op_type;
|
||||
// for op == REMOVE size in price_size is no-op
|
||||
PriceSize price_size;
|
||||
};
|
||||
|
||||
public:
|
||||
// complete list of all securities. as securities are added subsequent calls
|
||||
// on this callback are made. IMarketDataGateway guarantees that a security
|
||||
@@ -29,6 +39,7 @@ class IMarketDataListener {
|
||||
virtual void on_security_statistics(
|
||||
const domain::SecurityMarketDataStatistics &security_stats) = 0;
|
||||
virtual void on_book(const domain::Book &book) = 0;
|
||||
virtual void on_book_increment(const BookOp &) {}
|
||||
virtual void on_trades(
|
||||
const std::vector<domain::TradeRecord const *> &trades) = 0;
|
||||
virtual void on_rfqs(const std::vector<domain::RFQ const *> &rfqs) = 0;
|
||||
|
||||
Reference in new issue
Block a user