OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
OrderExecutedMsg.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 
25 
26 ONIXS_SGXTITAN_ITCH_NAMESPACE_BEGIN
27 
28  /// This message is sent whenever an order on the book
29  /// is executed in whole or in part.
30  struct ONIXS_SGXTITAN_ITCH_API OrderExecutedMsg : public IncomingMessage
31  {
32  /// Nanoseconds portion of the timestamp
33  UInt32 nanoseconds() const
34  {
35  return ordinary<UInt32>(1);
36  }
37 
38  /// The order ID is associated with the executed order
39  OrderId orderId() const
40  {
41  return ordinary<UInt64>(5);
42  }
43 
44  /// The Order Book ID
46  {
47  return ordinary<UInt32>(13);
48  }
49 
50  /// The type of order being added
51  Side::Enum side() const
53  {
54  return enumeration<Side>(17);
55  }
56 
57  /// The quantity being executed
59  {
60  return ordinary<UInt64>(18);
61  }
62 
63  /// Assigned by the system to each match executed
64  UInt64 matchId() const
65  {
66  return ordinary<UInt64>(26);
67  }
68 
69  /// Used to group Combination Order Book executions
70  /// and the trades in the constituent Order Books
71  /// together
72  UInt32 comboGroupId() const
73  {
74  return ordinary<UInt32>(34);
75  }
76 
77  ///
78  StrRef reserved1() const
80  {
81  return fixedStr<7>(38);
82  }
83 
84  ///
85  StrRef reserved2() const
87  {
88  return fixedStr<7>(45);
89  }
90 
91  /// Total message size.
93 
94  /// Check the given size.
95  static void validateSize(MessageSize size)
96  {
97  if(size < messageSize_)
98  throwIncorrectSize("OrderExecutedMsg", size, messageSize_);
99  }
100 
101  /// Initializes instance over given memory block.
102  OrderExecutedMsg(const void* data, MessageSize size)
104  : IncomingMessage(data, size)
105  {
106  }
107  };
108 
109  /// Serializes object into string.
110  ONIXS_SGXTITAN_ITCH_API void toStr(std::string&, const OrderExecutedMsg&);
111 
112  /// Serializes object into string.
113  inline std::string toStr(const OrderExecutedMsg& msg)
114  {
115  std::string str;
116  toStr(str, msg);
117  return str;
118  }
119 
120  ///
121  inline std::ostream& operator<<(std::ostream& stream, const OrderExecutedMsg& msg)
122  {
123  stream << toStr(msg);
124  return stream;
125  }
126 
127 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
UInt32 nanoseconds() const
Nanoseconds portion of the timestamp.
UInt64 OrderId
Alias for OrderId type.
Definition: Defines.h:40
#define ONIXS_SGXTITAN_ITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:46
static void validateSize(MessageSize size)
Check the given size.
Quantity executedQuantity() const
The quantity being executed.
#define ONIXS_SGXTITAN_ITCH_NOTHROW
Definition: Compiler.h:27
UInt64 Quantity
Alias for Quantity type.
Definition: Defines.h:46
UInt32 OrderBookId
Alias for Security Id type.
Definition: Defines.h:43
Side::Enum side() const
The type of order being added.
IncomingMessage(const void *data, MessageSize size)
UInt16 MessageSize
Aliases message length type.
Definition: Defines.h:34
OrderExecutedMsg(const void *data, MessageSize size)
Initializes instance over given memory block.
ONIXS_SGXTITAN_ITCH_API void toStr(std::string &, MessageType::Enum)
Appends string presentation of object.
UInt64 matchId() const
Assigned by the system to each match executed.
ONIXS_SGXTITAN_ITCH_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
OrderId orderId() const
The order ID is associated with the executed order.
ONIXS_SGXTITAN_ITCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:40
OrderBookId orderBookId() const
The Order Book ID.