kraken: add '--enable-trade'

This commit is contained in:
Bruno BELANYI 2022-03-12 13:59:44 +01:00
parent ef027c77f6
commit 832abfb224

View file

@ -5,12 +5,21 @@
#include "engine/engine.hh" #include "engine/engine.hh"
#include "parse/parse.hh" #include "parse/parse.hh"
int main() { int main(int argc, char** argv) {
auto cross_behaviour = kraken::engine::CrossBehaviour::REJECT;
if (argc > 1) {
using namespace std::literals;
if (argv[1] == "--enable-trade"sv) {
cross_behaviour = kraken::engine::CrossBehaviour::MATCH;
}
}
auto const orders = kraken::parse::parse_orders(std::cin); auto const orders = kraken::parse::parse_orders(std::cin);
auto listener = std::make_shared<kraken::engine::CsvEngineListener>(); auto listener = std::make_shared<kraken::engine::CsvEngineListener>();
auto engine = kraken::engine::Engine(listener); auto engine = kraken::engine::Engine(listener, cross_behaviour);
engine.process_orders(orders); engine.process_orders(orders);