From 1e8fcd794f64a4690402b9c834c5dd8a855da1bb Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Wed, 6 May 2020 12:22:33 -0500 Subject: [PATCH] Update ExecutionReport::exchange_order_id --- src/lib/orderman/actors/GLBXExecutionGateway.cpp | 4 +++- src/lib/orderman/actors/ICEExecutionGateway.cpp | 4 +++- src/lib/orderman/orderman_utils/ExecutionReport.h | 5 ++++- src/lib/orderman/orders/GLBXNativeOrder.cpp | 7 +++++-- src/lib/orderman/orders/ICENativeOrder.cpp | 10 ++++++++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/lib/orderman/actors/GLBXExecutionGateway.cpp b/src/lib/orderman/actors/GLBXExecutionGateway.cpp index 8adc93eee..48dd4d115 100644 --- a/src/lib/orderman/actors/GLBXExecutionGateway.cpp +++ b/src/lib/orderman/actors/GLBXExecutionGateway.cpp @@ -222,7 +222,9 @@ void GLBXExecutionGateway::on_exe_report( msg.get() ? api::orderman::MANUAL_ORDER_INDICATOR_YES : api::orderman::MANUAL_ORDER_INDICATOR_YES; - str_to(msg.get(), &data->exchange_order_id); + str_to(msg.get(), + & std::get( + data->exchange_order_id)); if (msg.has()) data->price = securities::decode_exchange_price( diff --git a/src/lib/orderman/actors/ICEExecutionGateway.cpp b/src/lib/orderman/actors/ICEExecutionGateway.cpp index e95de0f54..f4e6a0229 100644 --- a/src/lib/orderman/actors/ICEExecutionGateway.cpp +++ b/src/lib/orderman/actors/ICEExecutionGateway.cpp @@ -390,7 +390,9 @@ void ICEExecutionGateway::on_exe_report(const jetfix::fix::ICEExecutionReportMsg data->manual_order_indicator = api::orderman::MANUAL_ORDER_INDICATOR_NO; std::string oid_string = get_ice_order_id_string(msg); - str_to(oid_string, &data->exchange_order_id); + str_to(oid_string, + & std::get( + data->exchange_order_id)); data->ice_cl_ord_id = 0; if(msg.has()) data->ice_cl_ord_id = msg.get(); diff --git a/src/lib/orderman/orderman_utils/ExecutionReport.h b/src/lib/orderman/orderman_utils/ExecutionReport.h index 5ffc627b3..b403836bd 100644 --- a/src/lib/orderman/orderman_utils/ExecutionReport.h +++ b/src/lib/orderman/orderman_utils/ExecutionReport.h @@ -4,6 +4,7 @@ #include "lib/orderman/orderman_utils/orderman_common.h" #include "lib/mercury/common/mercury_common.h" #include "lib/config/protos/jetfix.pb.h" +#include namespace bts { namespace orderman { @@ -22,7 +23,9 @@ public: api::orderman::ExecType exec_type; api::orderman::NativeOrderStatus order_status; api::orderman::ManualOrderIndicator manual_order_indicator; - ExchangeOrderID exchange_order_id; + std::variant exchange_order_id; + // ExchangeOrderID exchange_order_id; + // ExchangeOrderIDu64 exchange_order_id_64; Price price; Quantity quantity; Quantity filled_quantity; diff --git a/src/lib/orderman/orders/GLBXNativeOrder.cpp b/src/lib/orderman/orders/GLBXNativeOrder.cpp index f1fbddb68..cbcb2f61b 100644 --- a/src/lib/orderman/orders/GLBXNativeOrder.cpp +++ b/src/lib/orderman/orders/GLBXNativeOrder.cpp @@ -308,7 +308,7 @@ GLBXNativeOrder::on_init_from_exe_report(ExecutionReport const &er, } auto &native_state = get_native_state(state); - native_state.set_exchange_order_id(to_trim_str(er.exchange_order_id)); + native_state.set_exchange_order_id(to_trim_str(std::get(er.exchange_order_id))); native_state.set_last_msg_seq_num(er.msg_seq_num); native_state.set_native_type(er.order_type); @@ -847,7 +847,10 @@ void GLBXNativeOrder::on_exe_report(const NewExecutionReportEvent &er) { native_state.set_native_type(er.data->order_type); bool got_first_exchange_order_id = !has_exchange_order_id(); if (got_first_exchange_order_id) { - me->exchange_order_id = to_trim_str(er.data->exchange_order_id); + me->exchange_order_id = + to_trim_str( + std::get( + er.data->exchange_order_id)); native_state.set_exchange_order_id(me->exchange_order_id); me->encoder->update_exchange_order_id(me->exchange_order_id); } diff --git a/src/lib/orderman/orders/ICENativeOrder.cpp b/src/lib/orderman/orders/ICENativeOrder.cpp index 0155bf4f1..79dad37c8 100644 --- a/src/lib/orderman/orders/ICENativeOrder.cpp +++ b/src/lib/orderman/orders/ICENativeOrder.cpp @@ -299,7 +299,10 @@ ICENativeOrder::on_init_from_exe_report(const ExecutionReport& er, const PreActi } auto &native_state = get_native_state(state); - native_state.set_exchange_order_id(to_trim_str(er.exchange_order_id)); + native_state.set_exchange_order_id( + to_trim_str( + std::get( + er.exchange_order_id))); native_state.set_last_msg_seq_num(er.msg_seq_num); native_state.set_native_type(er.order_type); @@ -859,7 +862,10 @@ void ICENativeOrder::on_exe_report(const NewExecutionReportEvent &er) bool got_first_exchange_order_id = !has_exchange_order_id(); if (got_first_exchange_order_id) { - me->exchange_order_id = to_trim_str(er.data->exchange_order_id); + me->exchange_order_id = + to_trim_str( + std::get( + er.data->exchange_order_id)); native_state.set_exchange_order_id(me->exchange_order_id); add_exchange_order_id_to_fix(); }