From 19e74c30f896f819bd5ea31eb80affcff6c6bcaf Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 12 May 2020 14:50:49 -0500 Subject: [PATCH] AlgoTestDriverBase - AlgoState << operator --- .../orders/algo/algo_orders/tests/AlgoTestDriver.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h index edc2845f0..5054d3822 100644 --- a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h +++ b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h @@ -159,4 +159,17 @@ struct AlgoTestDriver : public AlgoTestDriverBase const Algo& algo() const { return _algo; } }; +inline std::ostream& operator <<(std::ostream& ostr, const AlgoState& state) { + switch (state) { + case AlgoState::CREATED: ostr << "CREATED"; break; + case AlgoState::READY: ostr << "READY"; break; + case AlgoState::RUNNING: ostr << "RUNNING"; break; + case AlgoState::CANCELED: ostr << "CANCELED"; break; + case AlgoState::TERMINATED: ostr << "TERMINATED"; break; + case AlgoState::COMPLETED: ostr << "COMPLETED"; break; + default: ostr << "AlgoState_" << static_cast(state); break; + } + return ostr; +} + }}}//namespace