OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
EnterOrder.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 enter a new order into the system.
28  struct ONIXS_SGXTITAN_OUCH_API EnterOrder : public OutgoingMessage
29  {
30  /// Client-generated order identifier.
32  ONIXS_SGX_OUCH_NOTHROW
33  {
34  return fixedStr<14>(1);
35  }
36 
37  /// Order book ID.
39  ONIXS_SGX_OUCH_NOTHROW
40  {
41  return ordinary<Binary4>(15);
42  }
43 
44  /// Side
45  Side::Enum side() const
46  ONIXS_SGX_OUCH_NOTHROW
47  {
48  return enumeration<Side>(19);
49  }
50 
51  /// Quantity
52  Binary8 quantity() const
53  ONIXS_SGX_OUCH_NOTHROW
54  {
55  return ordinary<Binary8>(20);
56  }
57 
58  /// Signed integer price
60  ONIXS_SGX_OUCH_NOTHROW
61  {
62  return ordinary<BinaryPrice>(28);
63  }
64 
65  /// Time In Force
67  ONIXS_SGX_OUCH_NOTHROW
68  {
69  return enumeration<TimeInForce>(32);
70  }
71 
72  /// Defines the position update for the account.
74  ONIXS_SGX_OUCH_NOTHROW
75  {
76  return enumeration<EnterOrderOpenClose>(33);
77  }
78 
79  /// Mandatory in SGX-DT and validated in Matching
80  /// Engine.
82  ONIXS_SGX_OUCH_NOTHROW
83  {
84  return fixedStr<16>(34);
85  }
86 
87  /// Pass-thru field.
89  ONIXS_SGX_OUCH_NOTHROW
90  {
91  return fixedStr<15>(50);
92  }
93 
94  /// Pass-thru field.
96  ONIXS_SGX_OUCH_NOTHROW
97  {
98  return fixedStr<32>(65);
99  }
100 
101  /// Display quantity if reserved order, otherwise set
102  /// to zero.
104  ONIXS_SGX_OUCH_NOTHROW
105  {
106  return ordinary<Binary8>(97);
107  }
108 
109  /// The Self Trade Protection Key.
110  Binary2 stpKey() const
111  ONIXS_SGX_OUCH_NOTHROW
112  {
113  return ordinary<Binary2>(105);
114  }
115 
116  /// OUCH Order Type
118  ONIXS_SGX_OUCH_NOTHROW
119  {
120  return enumeration<OrderType>(107);
121  }
122 
123  /// Reserved for future use.
124  StrRef reserved() const
125  ONIXS_SGX_OUCH_NOTHROW
126  {
127  return fixedStr<5>(108);
128  }
129 
130  /// Client-generated order identifier.
131  void orderToken(StrRef value)
132  ONIXS_SGX_OUCH_NOTHROW
133  {
134  setFixedStr<14>(1, value);
135  }
136 
137  void orderToken(const char* value)
138  ONIXS_SGX_OUCH_NOTHROW
139  {
140  orderToken(StrRef(value, strnlen(value, 14)));
141  }
142 
143  /// Order book ID.
144  void orderBookId(Binary4 value)
145  ONIXS_SGX_OUCH_NOTHROW
146  {
147  setOrdinary(15, value);
148  }
149 
150  /// Side
151  void side(Side::Enum value)
152  ONIXS_SGX_OUCH_NOTHROW
153  {
154  setEnumeration<Side>(19, value);
155  }
156 
157  /// Quantity
158  void quantity(Binary8 value)
159  ONIXS_SGX_OUCH_NOTHROW
160  {
161  setOrdinary(20, value);
162  }
163 
164  /// Signed integer price
165  void price(const BinaryPrice& value)
166  ONIXS_SGX_OUCH_NOTHROW
167  {
168  setOrdinary(28, value);
169  }
170 
171  /// Time In Force
173  ONIXS_SGX_OUCH_NOTHROW
174  {
175  setEnumeration<TimeInForce>(32, value);
176  }
177 
178  /// Defines the position update for the account.
180  ONIXS_SGX_OUCH_NOTHROW
181  {
182  setEnumeration<EnterOrderOpenClose>(33, value);
183  }
184 
185  /// Mandatory in SGX-DT and validated in Matching
186  /// Engine.
187  void clientAccount(StrRef value)
188  ONIXS_SGX_OUCH_NOTHROW
189  {
190  setFixedStr<16>(34, value);
191  }
192 
193  void clientAccount(const char* value)
194  ONIXS_SGX_OUCH_NOTHROW
195  {
196  clientAccount(StrRef(value, strnlen(value, 16)));
197  }
198 
199  /// Pass-thru field.
200  void customerInfo(StrRef value)
201  ONIXS_SGX_OUCH_NOTHROW
202  {
203  setFixedStr<15>(50, value);
204  }
205 
206  void customerInfo(const char* value)
207  ONIXS_SGX_OUCH_NOTHROW
208  {
209  customerInfo(StrRef(value, strnlen(value, 15)));
210  }
211 
212  /// Pass-thru field.
213  void exchangeInfo(StrRef value)
214  ONIXS_SGX_OUCH_NOTHROW
215  {
216  setFixedStr<32>(65, value);
217  }
218 
219  void exchangeInfo(const char* value)
220  ONIXS_SGX_OUCH_NOTHROW
221  {
222  exchangeInfo(StrRef(value, strnlen(value, 32)));
223  }
224 
225  /// Display quantity if reserved order, otherwise set
226  /// to zero.
228  ONIXS_SGX_OUCH_NOTHROW
229  {
230  setOrdinary(97, value);
231  }
232 
233  /// The Self Trade Protection Key.
234  void stpKey(Binary2 value)
235  ONIXS_SGX_OUCH_NOTHROW
236  {
237  setOrdinary(105, value);
238  }
239 
240  /// OUCH Order Type
242  ONIXS_SGX_OUCH_NOTHROW
243  {
244  setEnumeration<OrderType>(107, value);
245  }
246 
247  /// Total message size.
248  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 113;
249 
250  /// Initializes empty instance
252  ONIXS_SGX_OUCH_NOTHROW
253  : OutgoingMessage(&type_, messageSize_)
255  , data_()
256  {
257  }
258 
259  private:
260 #pragma pack(push, 1)
261  Binary1 type_;
262  ONIXS_SGXTITAN_OUCH_UNUSED_FIELD Binary1 data_[messageSize_ - 1];
263 #pragma pack(pop)
264  };
265 
266  /// Serializes object into string.
267  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const EnterOrder&);
268 
269  /// Serializes object into string.
270  inline std::string toStr(const EnterOrder& msg)
271  {
272  std::string str;
273  toStr(str, msg);
274  return str;
275  }
276 
277  ///
278  inline std::ostream& operator<<(std::ostream& stream, const EnterOrder& msg)
279  {
280  stream << toStr(msg);
281  return stream;
282  }
283 
void exchangeInfo(const char *value)
Definition: EnterOrder.h:219
void quantity(Binary8 value)
Quantity.
Definition: EnterOrder.h:158
void openClose(EnterOrderOpenClose::Enum value)
Defines the position update for the account.
Definition: EnterOrder.h:179
void orderBookId(Binary4 value)
Order book ID.
Definition: EnterOrder.h:144
EnterOrder()
Initializes empty instance.
Definition: EnterOrder.h:251
void orderToken(StrRef value)
Client-generated order identifier.
Definition: EnterOrder.h:131
Binary2 stpKey() const
The Self Trade Protection Key.
Definition: EnterOrder.h:110
BinaryPrice price() const
Signed integer price.
Definition: EnterOrder.h:59
void stpKey(Binary2 value)
The Self Trade Protection Key.
Definition: EnterOrder.h:234
void timeInForce(TimeInForce::Enum value)
Time In Force.
Definition: EnterOrder.h:172
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
void clientAccount(const char *value)
Definition: EnterOrder.h:193
#define ONIXS_SGXTITAN_OUCH_UNUSED_FIELD
Definition: ABI.h:40
void customerInfo(StrRef value)
Pass-thru field.
Definition: EnterOrder.h:200
void price(const BinaryPrice &value)
Signed integer price.
Definition: EnterOrder.h:165
Side::Enum side() const
Side.
Definition: EnterOrder.h:45
void side(Side::Enum value)
Side.
Definition: EnterOrder.h:151
Binary4 orderBookId() const
Order book ID.
Definition: EnterOrder.h:38
void exchangeInfo(StrRef value)
Pass-thru field.
Definition: EnterOrder.h:213
void customerInfo(const char *value)
Definition: EnterOrder.h:206
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
void orderType(OrderType::Enum value)
OUCH Order Type.
Definition: EnterOrder.h:241
OrderType::Enum orderType() const
OUCH Order Type.
Definition: EnterOrder.h:117
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
Used to enter a new order into the system.
Definition: EnterOrder.h:28
Binary8 quantity() const
Quantity.
Definition: EnterOrder.h:52
TimeInForce::Enum timeInForce() const
Time In Force.
Definition: EnterOrder.h:66
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
StrRef reserved() const
Reserved for future use.
Definition: EnterOrder.h:124
StrRef orderToken() const
Client-generated order identifier.
Definition: EnterOrder.h:31
void setOrdinary(BlockSize offset, FieldValue value)
Assigns value of a field by its offset.
StrRef exchangeInfo() const
Pass-thru field.
Definition: EnterOrder.h:95
EnterOrderOpenClose::Enum openClose() const
Defines the position update for the account.
Definition: EnterOrder.h:73
StrRef customerInfo() const
Pass-thru field.
Definition: EnterOrder.h:88
SignedBinary4 BinaryPrice
Definition: Defines.h:36