OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
EquilibriumPriceUpdateMsg.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 used if/when auctions occur. The
29  /// message provides the changes in equilibrium price.
30  struct ONIXS_SGXTITAN_ITCH_API EquilibriumPriceUpdateMsg : public IncomingMessage
31  {
32  /// Nanoseconds portion of the timestamp
33  UInt32 nanoseconds() const
34  {
35  return ordinary<UInt32>(1);
36  }
37 
38  /// The Order Book ID
40  {
41  return ordinary<UInt32>(5);
42  }
43 
44  /// Quantity at equilibrium price on the bid side
46  {
47  return ordinary<UInt64>(9);
48  }
49 
50  /// Quantity at equilibrium price on the ask side
52  {
53  return ordinary<UInt64>(17);
54  }
55 
56  /// Equilibrium Price
58  {
59  return Price(ordinary<Int32>(25));
60  }
61 
62  /// Best Bid Price
64  {
65  return Price(ordinary<Int32>(29));
66  }
67 
68  /// Best Ask Price
70  {
71  return Price(ordinary<Int32>(33));
72  }
73 
74  /// Best Bid Quantity
76  {
77  return ordinary<UInt64>(37);
78  }
79 
80  /// Best Ask Quantity
82  {
83  return ordinary<UInt64>(45);
84  }
85 
86  /// Total message size.
88 
89  /// Check the given size.
90  static void validateSize(MessageSize size)
91  {
92  if(size < messageSize_)
93  throwIncorrectSize("EquilibriumPriceUpdateMsg", size, messageSize_);
94  }
95 
96  /// Initializes instance over given memory block.
97  EquilibriumPriceUpdateMsg(const void* data, MessageSize size)
99  : IncomingMessage(data, size)
100  {
101  }
102  };
103 
104  /// Serializes object into string.
105  ONIXS_SGXTITAN_ITCH_API void toStr(std::string&, const EquilibriumPriceUpdateMsg&);
106 
107  /// Serializes object into string.
108  inline std::string toStr(const EquilibriumPriceUpdateMsg& msg)
109  {
110  std::string str;
111  toStr(str, msg);
112  return str;
113  }
114 
115  ///
116  inline std::ostream& operator<<(std::ostream& stream, const EquilibriumPriceUpdateMsg& msg)
117  {
118  stream << toStr(msg);
119  return stream;
120  }
121 
122 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
#define ONIXS_SGXTITAN_ITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:46
#define ONIXS_SGXTITAN_ITCH_NOTHROW
Definition: Compiler.h:27
Quantity bidQuantity() const
Quantity at equilibrium price on the bid side.
Quantity askQuantity() const
Quantity at equilibrium price on the ask side.
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
static void validateSize(MessageSize size)
Check the given size.
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)
ONIXS_SGXTITAN_ITCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
EquilibriumPriceUpdateMsg(const void *data, MessageSize size)
Initializes instance over given memory block.
UInt32 nanoseconds() const
Nanoseconds portion of the timestamp.