kraken: engine: expose 'process_single_order'
This commit is contained in:
parent
e601250e7b
commit
8bba52d3b9
|
@ -91,10 +91,14 @@ Engine::Engine(std::shared_ptr<EngineListener> listener,
|
|||
CrossBehaviour cross_behaviour)
|
||||
: listener_(listener), cross_behaviour_(cross_behaviour) {}
|
||||
|
||||
void Engine::process_orders(std::vector<Order> const& orders) {
|
||||
for (auto const& order : orders) {
|
||||
void Engine::process_single_order(Order const& order) {
|
||||
std::visit([this](auto const& trade_order) { (*this)(trade_order); },
|
||||
order);
|
||||
}
|
||||
|
||||
void Engine::process_orders(std::vector<Order> const& orders) {
|
||||
for (auto const& order : orders) {
|
||||
process_single_order(order);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ struct Engine {
|
|||
Engine(std::shared_ptr<EngineListener> listener,
|
||||
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.
|
||||
void process_orders(std::vector<Order> const& orders);
|
||||
|
||||
|
|
Loading…
Reference in a new issue