kraken: engine: expose 'process_single_order'
This commit is contained in:
parent
e601250e7b
commit
8bba52d3b9
|
@ -91,11 +91,15 @@ Engine::Engine(std::shared_ptr<EngineListener> listener,
|
||||||
CrossBehaviour cross_behaviour)
|
CrossBehaviour cross_behaviour)
|
||||||
: listener_(listener), cross_behaviour_(cross_behaviour) {}
|
: listener_(listener), cross_behaviour_(cross_behaviour) {}
|
||||||
|
|
||||||
void Engine::process_orders(std::vector<Order> const& orders) {
|
void Engine::process_single_order(Order const& order) {
|
||||||
for (auto const& order : orders) {
|
|
||||||
std::visit([this](auto const& trade_order) { (*this)(trade_order); },
|
std::visit([this](auto const& trade_order) { (*this)(trade_order); },
|
||||||
order);
|
order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Engine::process_orders(std::vector<Order> const& orders) {
|
||||||
|
for (auto const& order : orders) {
|
||||||
|
process_single_order(order);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::operator()(TradeOrder const& trade_order) {
|
void Engine::operator()(TradeOrder const& trade_order) {
|
||||||
|
|
|
@ -25,6 +25,9 @@ struct Engine {
|
||||||
Engine(std::shared_ptr<EngineListener> listener,
|
Engine(std::shared_ptr<EngineListener> listener,
|
||||||
CrossBehaviour cross_behaviour = CrossBehaviour::REJECT);
|
CrossBehaviour cross_behaviour = CrossBehaviour::REJECT);
|
||||||
|
|
||||||
|
/// Process a single order, triggerring the listener appropriately.
|
||||||
|
void process_single_order(Order const& order);
|
||||||
|
|
||||||
/// Process orders, triggerring the listener on each event.
|
/// Process orders, triggerring the listener on each event.
|
||||||
void process_orders(std::vector<Order> const& orders);
|
void process_orders(std::vector<Order> const& orders);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue