OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
OrderReplaced.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 
23 
24 
26 
27  /// This message acknowledges the receipt and
28  /// acceptance of a valid Replace Order Message.
29  struct ONIXS_SGXTITAN_OUCH_API OrderReplaced : public IncomingMessage
30  {
31  /// UNIX Time
33  {
34  return ordinary<DateTime>(1);
35  }
36 
37  /// OrderToken
39  ONIXS_SGX_OUCH_NOTHROW
40  {
41  return fixedStr<14>(9);
42  }
43 
44  /// OrderToken
46  ONIXS_SGX_OUCH_NOTHROW
47  {
48  return fixedStr<14>(23);
49  }
50 
51  /// Order book ID
53  ONIXS_SGX_OUCH_NOTHROW
54  {
55  return ordinary<Binary4>(37);
56  }
57 
58  /// Side
59  Side::Enum side() const
60  ONIXS_SGX_OUCH_NOTHROW
61  {
62  return enumeration<Side>(41);
63  }
64 
65  /// The identifier assigned to the new order. Note
66  /// that the number is only unique per Order book and
67  /// side
68  Binary8 orderId() const
69  ONIXS_SGX_OUCH_NOTHROW
70  {
71  return ordinary<Binary8>(42);
72  }
73 
74  /// Quantity currently open in the book
75  Binary8 quantity() const
76  ONIXS_SGX_OUCH_NOTHROW
77  {
78  return ordinary<Binary8>(50);
79  }
80 
81  /// Signed integer price
83  ONIXS_SGX_OUCH_NOTHROW
84  {
85  return ordinary<BinaryPrice>(58);
86  }
87 
88  /// Time In Force
90  ONIXS_SGX_OUCH_NOTHROW
91  {
92  return enumeration<TimeInForce>(62);
93  }
94 
95  /// Defines the position update for the account
97  ONIXS_SGX_OUCH_NOTHROW
98  {
99  return enumeration<ReplaceOrderOpenClose>(63);
100  }
101 
102  /// Mandatory in SGX-DT and validated in Matching
103  /// Engine
105  ONIXS_SGX_OUCH_NOTHROW
106  {
107  return fixedStr<16>(64);
108  }
109 
110  ///
112  ONIXS_SGX_OUCH_NOTHROW
113  {
114  return enumeration<OrderState>(80);
115  }
116 
117  /// Pass-thru field
119  ONIXS_SGX_OUCH_NOTHROW
120  {
121  return fixedStr<15>(81);
122  }
123 
124  /// Pass-thru field
126  ONIXS_SGX_OUCH_NOTHROW
127  {
128  return fixedStr<32>(96);
129  }
130 
131  /// Pre Trade Quantity
133  ONIXS_SGX_OUCH_NOTHROW
134  {
135  return ordinary<Binary8>(128);
136  }
137 
138  /// The displayed quantity in case the order is a
139  /// reserve order or zero if the order is not a
140  /// reserve order
142  ONIXS_SGX_OUCH_NOTHROW
143  {
144  return ordinary<Binary8>(136);
145  }
146 
147  /// The Self Trade Protection Key.
148  Binary2 stpKey() const
149  ONIXS_SGX_OUCH_NOTHROW
150  {
151  return ordinary<Binary2>(144);
152  }
153 
154  /// Reserved for future use.
155  StrRef reserved() const
156  ONIXS_SGX_OUCH_NOTHROW
157  {
158  return fixedStr<2>(146);
159  }
160 
161  /// Total message size.
162  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 148;
163 
164  /// Check the given size.
165  static void validateSize(MessageSize size)
166  {
167  if(size < messageSize_)
168  throwIncorrectSize("OrderReplaced", size, messageSize_);
169  }
170 
171  /// Initializes instance over given memory block.
172  OrderReplaced(const void* data, MessageSize size)
173  ONIXS_SGX_OUCH_NOTHROW
174  : IncomingMessage(data, size)
175  {
176  }
177  };
178 
179  /// Serializes object into string.
180  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const OrderReplaced&);
181 
182  /// Serializes object into string.
183  inline std::string toStr(const OrderReplaced& msg)
184  {
185  std::string str;
186  toStr(str, msg);
187  return str;
188  }
189 
190  ///
191  inline std::ostream& operator<<(std::ostream& stream, const OrderReplaced& msg)
192  {
193  stream << toStr(msg);
194  return stream;
195  }
196 
ReplaceOrderOpenClose::Enum openClose() const
Defines the position update for the account.
Definition: OrderReplaced.h:96
Binary2 stpKey() const
The Self Trade Protection Key.
StrRef exchangeInfo() const
Pass-thru field.
IncomingMessage(const void *data, MessageSize size)
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
TimeInForce::Enum timeInForce() const
Time In Force.
Definition: OrderReplaced.h:89
OrderReplaced(const void *data, MessageSize size)
Initializes instance over given memory block.
ONIXS_SGXTITAN_OUCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
StrRef previousOrderToken() const
OrderToken.
Definition: OrderReplaced.h:45
ONIXS_SGXTITAN_OUCH_API std::ostream & operator<<(std::ostream &stream, HandlerState::Enum value)
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:41
BinaryPrice price() const
Signed integer price.
Definition: OrderReplaced.h:82
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
StrRef replacementOrderToken() const
OrderToken.
Definition: OrderReplaced.h:38
static void validateSize(MessageSize size)
Check the given size.
StrRef reserved() const
Reserved for future use.
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
Binary8 preTradeQuantity() const
Pre Trade Quantity.
StrRef customerInfo() const
Pass-thru field.
DateTime timestamp() const
UNIX Time.
Definition: OrderReplaced.h:32
Binary8 quantity() const
Quantity currently open in the book.
Definition: OrderReplaced.h:75
Binary4 orderBookId() const
Order book ID.
Definition: OrderReplaced.h:52
SignedBinary4 BinaryPrice
Definition: Defines.h:36