diff --git a/src/lib/orderman/actors/ilink3/IL3ExecutionReportParser.cpp b/src/lib/orderman/actors/ilink3/IL3ExecutionReportParser.cpp index f11ca3b1f..f59710ede 100644 --- a/src/lib/orderman/actors/ilink3/IL3ExecutionReportParser.cpp +++ b/src/lib/orderman/actors/ilink3/IL3ExecutionReportParser.cpp @@ -47,6 +47,9 @@ void IL3ExecutionReportParser::common(const T& msg, ExecutionReport* data) { data->stop_price = Price { 0.0 }; data->time_in_force = map_time_in_force(msg.timeInForce()); data->transact_time = ExchangeTimeStamp64 { msg.transactTime() }; + + data->ice_cl_ord_id = 0; + data->ice_company_id = 0; } bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportNew522& msg, ExecutionReport* data) { @@ -57,8 +60,6 @@ bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportNew522& m data->exchange_fill_id = ExchangeFillID { }; data->exec_type = api::orderman::EXEC_TYPE_NEW; data->filled_quantity = Quantity { 0 }; - data->ice_cl_ord_id = 0; - data->ice_company_id = 0; data->last_price = Price { 0.0 }; data->last_shares = Quantity { 0 }; data->max_show = Quantity { 0 }; diff --git a/src/lib/orderman/actors/ilink3/ILinkGW.cpp b/src/lib/orderman/actors/ilink3/ILinkGW.cpp index 2b2a3abe0..e059324d4 100644 --- a/src/lib/orderman/actors/ilink3/ILinkGW.cpp +++ b/src/lib/orderman/actors/ilink3/ILinkGW.cpp @@ -575,36 +575,39 @@ void ILinkGW::handle(const iLinkBinary::BusinessReject521& msg) { set_state(State::ERROR); } void ILinkGW::handle(const iLinkBinary::ExecutionReportNew522& msg) { - auto* report = _pool.construct(); - bool result = _exe_parser.parse(msg, report); - bts_assert(result); - _on_exe_report(report); + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportReject523& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportElimination524& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportTradeOutright525& msg) { + handle_exe_report(msg); log_in(msg); - if (msg.uUID() != _session.uuid) { - } } void ILinkGW::handle(const iLinkBinary::ExecutionReportTradeSpread526& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportTradeSpreadLeg527& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportModify531& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportStatus532& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::ExecutionReportCancel534& msg) { + handle_exe_report(msg); log_in(msg); } void ILinkGW::handle(const iLinkBinary::OrderCancelReject535& msg) { diff --git a/src/lib/orderman/actors/ilink3/ILinkGW.h b/src/lib/orderman/actors/ilink3/ILinkGW.h index 23845e92e..2e80f00f1 100644 --- a/src/lib/orderman/actors/ilink3/ILinkGW.h +++ b/src/lib/orderman/actors/ilink3/ILinkGW.h @@ -126,6 +126,18 @@ private: size_t on_data(const std::string_view&) override; + template + void handle_exe_report(const T& msg) { + auto* report = _pool.construct(); + bool result = _exe_parser.parse(msg, report); + if (result) _on_exe_report(report); + else { + LOG(OrderMan, Error, "Failed to parse error report"); + } + } + // void exe_report_error( + + public: void handle(const iLinkBinary::NegotiationResponse501&); void handle(const iLinkBinary::NegotiationReject502&);