OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
OrderReplaceMsg.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  /// has been replaced.
30  struct ONIXS_SGXTITAN_ITCH_API OrderReplaceMsg : public IncomingMessage
31  {
32  /// Nanoseconds portion of the timestamp
33  UInt32 nanoseconds() const
34  {
35  return ordinary<UInt32>(1);
36  }
37 
38  /// The original order identifier of the order being
39  /// replaced
40  OrderId orderId() const
41  {
42  return ordinary<UInt64>(5);
43  }
44 
45  /// The Order Book ID
47  {
48  return ordinary<UInt32>(13);
49  }
50 
51  /// The type of order being added
52  Side::Enum side() const
54  {
55  return enumeration<Side>(17);
56  }
57 
58  /// New Rank within Order Book
59  UInt32 newOrderBookPosition() const
60  {
61  return ordinary<UInt32>(18);
62  }
63 
64  /// The new visible quantity of the order
66  {
67  return ordinary<UInt64>(22);
68  }
69 
70  /// The new Price of the order
71  Price price() const
72  {
73  return Price(ordinary<Int32>(30));
74  }
75 
76  /// Additional order attributes, values: 0 = Not
77  /// applicable, 8192 = Bait / implied order
78  UInt16 orderAttributes() const
79  {
80  return ordinary<UInt16>(34);
81  }
82 
83  /// Total message size.
85 
86  /// Check the given size.
87  static void validateSize(MessageSize size)
88  {
89  if(size < messageSize_)
90  throwIncorrectSize("OrderReplaceMsg", size, messageSize_);
91  }
92 
93  /// Initializes instance over given memory block.
94  OrderReplaceMsg(const void* data, MessageSize size)
96  : IncomingMessage(data, size)
97  {
98  }
99  };
100 
101  /// Serializes object into string.
102  ONIXS_SGXTITAN_ITCH_API void toStr(std::string&, const OrderReplaceMsg&);
103 
104  /// Serializes object into string.
105  inline std::string toStr(const OrderReplaceMsg& msg)
106  {
107  std::string str;
108  toStr(str, msg);
109  return str;
110  }
111 
112  ///
113  inline std::ostream& operator<<(std::ostream& stream, const OrderReplaceMsg& msg)
114  {
115  stream << toStr(msg);
116  return stream;
117  }
118 
119 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
OrderBookId orderBookId() const
The Order Book ID.
Quantity quantity() const
The new visible quantity of the order.
OrderReplaceMsg(const void *data, MessageSize size)
Initializes instance over given memory block.
#define ONIXS_SGXTITAN_ITCH_NOTHROW
Definition: Compiler.h:27
UInt64 Quantity
Alias for Quantity type.
Definition: Defines.h:46
static void validateSize(MessageSize size)
Check the given size.
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
Price price() const
The new Price of the order.
Side::Enum side() const
The type of order being added.
ONIXS_SGXTITAN_ITCH_API void toStr(std::string &, MessageType::Enum)
Appends string presentation of object.
ONIXS_SGXTITAN_ITCH_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
UInt32 newOrderBookPosition() const
New Rank within Order Book.
ONIXS_SGXTITAN_ITCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)