1 /****************************************************************************** 2 ** $Header: svn+ssh://jmmcg@svn.code.sf.net/p/libjmmcg/code/trunk/libjmmcg/isimud/exchanges/common/processing_rules_impl.hpp 2330 2018-09-26 03:49:30Z jmmcg $ 3 ** 4 ** Copyright (c) 2015 by J.M.McGuiness, isimud@hussar.me.uk 5 ** 6 ** This library is free software; you can redistribute it and/or 7 ** modify it under the terms of the GNU Lesser General Public 8 ** License as published by the Free Software Foundation; either 9 ** version 2.1 of the License, or (at your option) any later version. 10 ** 11 ** This library is distributed in the hope that it will be useful, 12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 ** Lesser General Public License for more details. 15 ** 16 ** You should have received a copy of the GNU Lesser General Public 17 ** License along with this library; if not, write to the Free Software 18 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 namespace isimud { namespace exchanges { namespace common { 22 23 template<class MsgDetails, class Derived, class SktT> inline std::string 24 simulator_responses<MsgDetails, Derived, SktT>::to_string() const noexcept(false) { 25 std::ostringstream os; 26 os 27 <<"\n\tUsername: '"<<username<<"'" 28 "\n\tPassword: '"<<password<<"'" 29 "\n\tNew password: '"<<new_password<<"'" 30 "\n\tQuantity limit="<<quantity_limit 31 <<"\n\tPrice="<<price 32 <<"\n\tScaled price="<<scaled_price 33 <<"\n\tCurrent sequence number="<<sequenceNumber 34 <<"\n\tMessage details: "; 35 MsgDetails::to_stream(os); 36 return os.str(); 37 } 38 39 template<class MsgDetails, class Derived, class SktT> inline std::ostream & 40 operator<<(std::ostream &os, simulator_responses<MsgDetails, Derived, SktT> const &ec) noexcept(false) { 41 os<<ec.to_string(); 42 return os; 43 } 44 45 } } }