OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
Messages.ProtocolFormatting.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #pragma once
21 
22 #include <util/TextBuilder.h>
23 
33 
34 
35 namespace OnixS
36 {
37  namespace Util
38  {
39  inline
40  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::EnterOrder& msg)
41  {
42  return tb << toStr(msg);
43  }
44 
45  inline
46  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::ReplaceOrder& msg)
47  {
48  return tb << toStr(msg);
49  }
50 
51  inline
52  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::CancelOrder& msg)
53  {
54  return tb << toStr(msg);
55  }
56 
57  inline
58  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::CancelByOrderId& msg)
59  {
60  return tb << toStr(msg);
61  }
62 
63  inline
64  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OrderAccepted& msg)
65  {
66  return tb << toStr(msg);
67  }
68 
69  inline
70  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OrderRejected& msg)
71  {
72  return tb << toStr(msg);
73  }
74 
75  inline
76  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OrderReplaced& msg)
77  {
78  return tb << toStr(msg);
79  }
80 
81  inline
82  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OrderCancelled& msg)
83  {
84  return tb << toStr(msg);
85  }
86 
87  inline
88  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OrderExecuted& msg)
89  {
90  return tb << toStr(msg);
91  }
92 
93  inline
94  TextBuilder& operator<<(TextBuilder& tb, const OnixS::SgxTitan::Trading::Ouch::OutgoingMessage& msg)
95  {
97 
98  if (OnixS::SgxTitan::Trading::Ouch::OutboundMessageTypes::EnterOrder == messageType) tb << static_cast<const OnixS::SgxTitan::Trading::Ouch::EnterOrder&>(msg); else
99  if (OnixS::SgxTitan::Trading::Ouch::OutboundMessageTypes::ReplaceOrder == messageType) tb << static_cast<const OnixS::SgxTitan::Trading::Ouch::ReplaceOrder&>(msg); else
100  if (OnixS::SgxTitan::Trading::Ouch::OutboundMessageTypes::CancelOrder == messageType) tb << static_cast<const OnixS::SgxTitan::Trading::Ouch::CancelOrder&>(msg); else
101  if (OnixS::SgxTitan::Trading::Ouch::OutboundMessageTypes::CancelByOrderId == messageType) tb << static_cast<const OnixS::SgxTitan::Trading::Ouch::CancelByOrderId&>(msg); else
102  tb << "Unknown message";
103 
104  return tb;
105  }
106 
107  }
108 }
TextBuilder & operator<<(TextBuilder &tb, const OnixS::SgxTitan::Trading::Ouch::EnterOrder &msg)
OutboundMessageTypes::Enum type() const
Type.
Used to enter a new order into the system.
Definition: EnterOrder.h:28
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
Used to modify an existing order entered via OUCH.
Definition: ReplaceOrder.h:28