OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
ReplaceOrder.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  /// Used to modify an existing order entered via OUCH.
28  struct ONIXS_SGXTITAN_OUCH_API ReplaceOrder : public OutgoingMessage
29  {
30  /// Should be the Order Token from the original Enter
31  /// Order, not from any intermediate replaces.
33  ONIXS_SGX_OUCH_NOTHROW
34  {
35  return fixedStr<14>(1);
36  }
37 
38  /// Replacement Order Token.
40  ONIXS_SGX_OUCH_NOTHROW
41  {
42  return fixedStr<14>(15);
43  }
44 
45  /// Quantity
46  Binary8 quantity() const
47  ONIXS_SGX_OUCH_NOTHROW
48  {
49  return ordinary<Binary8>(29);
50  }
51 
52  /// Signed integer price
54  ONIXS_SGX_OUCH_NOTHROW
55  {
56  return ordinary<BinaryPrice>(37);
57  }
58 
59  /// Defines the position update for the account.
61  ONIXS_SGX_OUCH_NOTHROW
62  {
63  return enumeration<ReplaceOrderOpenClose>(41);
64  }
65 
66  /// Mandatory in SGX-DT and validated in Matching
67  /// Engine
69  ONIXS_SGX_OUCH_NOTHROW
70  {
71  return fixedStr<16>(42);
72  }
73 
74  /// Pass-thru field
76  ONIXS_SGX_OUCH_NOTHROW
77  {
78  return fixedStr<15>(58);
79  }
80 
81  /// Pass-thru field
83  ONIXS_SGX_OUCH_NOTHROW
84  {
85  return fixedStr<32>(73);
86  }
87 
88  /// Display quantity.
90  ONIXS_SGX_OUCH_NOTHROW
91  {
92  return ordinary<Binary8>(105);
93  }
94 
95  /// The Self Trade Protection Key.
96  Binary2 stpKey() const
97  ONIXS_SGX_OUCH_NOTHROW
98  {
99  return ordinary<Binary2>(113);
100  }
101 
102  /// Reserved for future use.
103  StrRef reserved() const
104  ONIXS_SGX_OUCH_NOTHROW
105  {
106  return fixedStr<6>(115);
107  }
108 
109  /// Should be the Order Token from the original Enter
110  /// Order, not from any intermediate replaces.
112  ONIXS_SGX_OUCH_NOTHROW
113  {
114  setFixedStr<14>(1, value);
115  }
116 
117  void existingOrderToken(const char* value)
118  ONIXS_SGX_OUCH_NOTHROW
119  {
120  existingOrderToken(StrRef(value, strnlen(value, 14)));
121  }
122 
123  /// Replacement Order Token.
125  ONIXS_SGX_OUCH_NOTHROW
126  {
127  setFixedStr<14>(15, value);
128  }
129 
130  void replacementOrderToken(const char* value)
131  ONIXS_SGX_OUCH_NOTHROW
132  {
133  replacementOrderToken(StrRef(value, strnlen(value, 14)));
134  }
135 
136  /// Quantity
137  void quantity(Binary8 value)
138  ONIXS_SGX_OUCH_NOTHROW
139  {
140  setOrdinary(29, value);
141  }
142 
143  /// Signed integer price
144  void price(const BinaryPrice& value)
145  ONIXS_SGX_OUCH_NOTHROW
146  {
147  setOrdinary(37, value);
148  }
149 
150  /// Defines the position update for the account.
152  ONIXS_SGX_OUCH_NOTHROW
153  {
154  setEnumeration<ReplaceOrderOpenClose>(41, value);
155  }
156 
157  /// Mandatory in SGX-DT and validated in Matching
158  /// Engine
159  void clientAccount(StrRef value)
160  ONIXS_SGX_OUCH_NOTHROW
161  {
162  setFixedStr<16>(42, value);
163  }
164 
165  void clientAccount(const char* value)
166  ONIXS_SGX_OUCH_NOTHROW
167  {
168  clientAccount(StrRef(value, strnlen(value, 16)));
169  }
170 
171  /// Pass-thru field
172  void customerInfo(StrRef value)
173  ONIXS_SGX_OUCH_NOTHROW
174  {
175  setFixedStr<15>(58, value);
176  }
177 
178  void customerInfo(const char* value)
179  ONIXS_SGX_OUCH_NOTHROW
180  {
181  customerInfo(StrRef(value, strnlen(value, 15)));
182  }
183 
184  /// Pass-thru field
185  void exchangeInfo(StrRef value)
186  ONIXS_SGX_OUCH_NOTHROW
187  {
188  setFixedStr<32>(73, value);
189  }
190 
191  void exchangeInfo(const char* value)
192  ONIXS_SGX_OUCH_NOTHROW
193  {
194  exchangeInfo(StrRef(value, strnlen(value, 32)));
195  }
196 
197  /// Display quantity.
199  ONIXS_SGX_OUCH_NOTHROW
200  {
201  setOrdinary(105, value);
202  }
203 
204  /// The Self Trade Protection Key.
205  void stpKey(Binary2 value)
206  ONIXS_SGX_OUCH_NOTHROW
207  {
208  setOrdinary(113, value);
209  }
210 
211  /// Total message size.
212  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 121;
213 
214  /// Initializes empty instance
216  ONIXS_SGX_OUCH_NOTHROW
217  : OutgoingMessage(&type_, messageSize_)
219  , data_()
220  {
221  }
222 
223  private:
224 #pragma pack(push, 1)
225  Binary1 type_;
226  ONIXS_SGXTITAN_OUCH_UNUSED_FIELD Binary1 data_[messageSize_ - 1];
227 #pragma pack(pop)
228  };
229 
230  /// Serializes object into string.
231  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const ReplaceOrder&);
232 
233  /// Serializes object into string.
234  inline std::string toStr(const ReplaceOrder& msg)
235  {
236  std::string str;
237  toStr(str, msg);
238  return str;
239  }
240 
241  ///
242  inline std::ostream& operator<<(std::ostream& stream, const ReplaceOrder& msg)
243  {
244  stream << toStr(msg);
245  return stream;
246  }
247 
StrRef replacementOrderToken() const
Replacement Order Token.
Definition: ReplaceOrder.h:39
Binary2 stpKey() const
The Self Trade Protection Key.
Definition: ReplaceOrder.h:96
void customerInfo(StrRef value)
Pass-thru field.
Definition: ReplaceOrder.h:172
void openClose(ReplaceOrderOpenClose::Enum value)
Defines the position update for the account.
Definition: ReplaceOrder.h:151
void displayQuantity(Binary8 value)
Display quantity.
Definition: ReplaceOrder.h:198
void quantity(Binary8 value)
Quantity.
Definition: ReplaceOrder.h:137
Binary8 displayQuantity() const
Display quantity.
Definition: ReplaceOrder.h:89
StrRef exchangeInfo() const
Pass-thru field.
Definition: ReplaceOrder.h:82
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
#define ONIXS_SGXTITAN_OUCH_UNUSED_FIELD
Definition: ABI.h:40
ReplaceOrder()
Initializes empty instance.
Definition: ReplaceOrder.h:215
void stpKey(Binary2 value)
The Self Trade Protection Key.
Definition: ReplaceOrder.h:205
StrRef reserved() const
Reserved for future use.
Definition: ReplaceOrder.h:103
void replacementOrderToken(const char *value)
Definition: ReplaceOrder.h:130
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
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
void replacementOrderToken(StrRef value)
Replacement Order Token.
Definition: ReplaceOrder.h:124
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
BinaryPrice price() const
Signed integer price.
Definition: ReplaceOrder.h:53
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
void exchangeInfo(StrRef value)
Pass-thru field.
Definition: ReplaceOrder.h:185
void price(const BinaryPrice &value)
Signed integer price.
Definition: ReplaceOrder.h:144
StrRef customerInfo() const
Pass-thru field.
Definition: ReplaceOrder.h:75
void setOrdinary(BlockSize offset, FieldValue value)
Assigns value of a field by its offset.
ReplaceOrderOpenClose::Enum openClose() const
Defines the position update for the account.
Definition: ReplaceOrder.h:60
SignedBinary4 BinaryPrice
Definition: Defines.h:36
Used to modify an existing order entered via OUCH.
Definition: ReplaceOrder.h:28