OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
OrderExecutedWithPriceMsg.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 in the relatively rare event
29  /// when an order on the book is executed in whole or
30  /// in part with a price different than the initial
31  /// display price.
32  struct ONIXS_SGXTITAN_ITCH_API OrderExecutedWithPriceMsg : public IncomingMessage
33  {
34  /// Nanoseconds portion of the timestamp
35  UInt32 nanoseconds() const
36  {
37  return ordinary<UInt32>(1);
38  }
39 
40  /// The order ID is associated with the executed order
41  OrderId orderId() const
42  {
43  return ordinary<UInt64>(5);
44  }
45 
46  /// The Order Book ID
48  {
49  return ordinary<UInt32>(13);
50  }
51 
52  /// The type of order being added
53  Side::Enum side() const
55  {
56  return enumeration<Side>(17);
57  }
58 
59  /// The quantity being executed
61  {
62  return ordinary<UInt64>(18);
63  }
64 
65  /// Assigned by the system to each match executed
66  UInt64 matchId() const
67  {
68  return ordinary<UInt64>(26);
69  }
70 
71  /// Used to group Combination Order Book executions
72  /// and the trades in the constituent Order Books
73  /// together
74  UInt32 comboGroupId() const
75  {
76  return ordinary<UInt32>(34);
77  }
78 
79  ///
80  StrRef reserved1() const
82  {
83  return fixedStr<7>(38);
84  }
85 
86  ///
87  StrRef reserved2() const
89  {
90  return fixedStr<7>(45);
91  }
92 
93  /// Trade Price
94  Price tradePrice() const
95  {
96  return Price(ordinary<Int32>(52));
97  }
98 
99  /// Occurred at Cross
102  {
103  return enumeration<OccurredAtCross>(56);
104  }
105 
106  /// Indicates if the trade should be included in trade
107  /// tickers and volume calculations
110  {
111  return enumeration<Printable>(57);
112  }
113 
114  /// Total message size.
116 
117  /// Check the given size.
118  static void validateSize(MessageSize size)
119  {
120  if(size < messageSize_)
121  throwIncorrectSize("OrderExecutedWithPriceMsg", size, messageSize_);
122  }
123 
124  /// Initializes instance over given memory block.
125  OrderExecutedWithPriceMsg(const void* data, MessageSize size)
127  : IncomingMessage(data, size)
128  {
129  }
130  };
131 
132  /// Serializes object into string.
133  ONIXS_SGXTITAN_ITCH_API void toStr(std::string&, const OrderExecutedWithPriceMsg&);
134 
135  /// Serializes object into string.
136  inline std::string toStr(const OrderExecutedWithPriceMsg& msg)
137  {
138  std::string str;
139  toStr(str, msg);
140  return str;
141  }
142 
143  ///
144  inline std::ostream& operator<<(std::ostream& stream, const OrderExecutedWithPriceMsg& msg)
145  {
146  stream << toStr(msg);
147  return stream;
148  }
149 
150 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
UInt64 OrderId
Alias for OrderId type.
Definition: Defines.h:40
#define ONIXS_SGXTITAN_ITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:46
#define ONIXS_SGXTITAN_ITCH_NOTHROW
Definition: Compiler.h:27
OccurredAtCross::Enum occurredAtCross() const
Occurred at Cross.
OrderExecutedWithPriceMsg(const void *data, MessageSize size)
Initializes instance over given memory block.
UInt64 Quantity
Alias for Quantity type.
Definition: Defines.h:46
UInt32 OrderBookId
Alias for Security Id type.
Definition: Defines.h:43
IncomingMessage(const void *data, MessageSize size)
UInt16 MessageSize
Aliases message length type.
Definition: Defines.h:34
Side::Enum side() const
The type of order being added.
UInt64 matchId() const
Assigned by the system to each match executed.
ONIXS_SGXTITAN_ITCH_API void toStr(std::string &, MessageType::Enum)
Appends string presentation of object.
Quantity executedQuantity() const
The quantity being executed.
ONIXS_SGXTITAN_ITCH_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
static void validateSize(MessageSize size)
Check the given size.
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
UInt32 nanoseconds() const
Nanoseconds portion of the timestamp.