OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
OrderExecuted.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 is returned when a partial or full
28  /// fill occurs.
29  struct ONIXS_SGXTITAN_OUCH_API OrderExecuted : 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  /// Traded Quantity
53  ONIXS_SGX_OUCH_NOTHROW
54  {
55  return ordinary<Binary8>(27);
56  }
57 
58  /// Signed integer price
60  ONIXS_SGX_OUCH_NOTHROW
61  {
62  return ordinary<BinaryPrice>(35);
63  }
64 
65  /// Backend-generated identifier
66  Binary12 matchId() const
67  ONIXS_SGX_OUCH_NOTHROW
68  {
69  return ordinary<Binary12>(39);
70  }
71 
72  /// Reserved for future use
73  StrRef reserved() const
74  ONIXS_SGX_OUCH_NOTHROW
75  {
76  return fixedStr<16>(51);
77  }
78 
79  /// Total message size.
80  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 67;
81 
82  /// Check the given size.
83  static void validateSize(MessageSize size)
84  {
85  if(size < messageSize_)
86  throwIncorrectSize("OrderExecuted", size, messageSize_);
87  }
88 
89  /// Initializes instance over given memory block.
90  OrderExecuted(const void* data, MessageSize size)
91  ONIXS_SGX_OUCH_NOTHROW
92  : IncomingMessage(data, size)
93  {
94  }
95  };
96 
97  /// Serializes object into string.
98  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const OrderExecuted&);
99 
100  /// Serializes object into string.
101  inline std::string toStr(const OrderExecuted& msg)
102  {
103  std::string str;
104  toStr(str, msg);
105  return str;
106  }
107 
108  ///
109  inline std::ostream& operator<<(std::ostream& stream, const OrderExecuted& msg)
110  {
111  stream << toStr(msg);
112  return stream;
113  }
114 
OrderExecuted(const void *data, MessageSize size)
Initializes instance over given memory block.
Definition: OrderExecuted.h:90
IncomingMessage(const void *data, MessageSize size)
Binary4 orderBookId() const
Order book ID.
Definition: OrderExecuted.h:45
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
ONIXS_SGXTITAN_OUCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
static void validateSize(MessageSize size)
Check the given size.
Definition: OrderExecuted.h:83
BinaryPrice tradedPrice() const
Signed integer price.
Definition: OrderExecuted.h:59
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
Binary8 tradedQuantity() const
Traded Quantity.
Definition: OrderExecuted.h:52
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
DateTime timestamp() const
UNIX Time.
Definition: OrderExecuted.h:32
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
StrRef orderToken() const
Order Token.
Definition: OrderExecuted.h:38
Binary12 matchId() const
Backend-generated identifier.
Definition: OrderExecuted.h:66
SignedBinary4 BinaryPrice
Definition: Defines.h:36
StrRef reserved() const
Reserved for future use.
Definition: OrderExecuted.h:73