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