OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
OrderBookDirectoryMsg.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  /// At the start of each trading day, Order Book
29  /// directory messages are disseminated for all active
30  /// instruments, including halted instruments, in the
31  /// Trading system.
32  struct ONIXS_SGXTITAN_ITCH_API OrderBookDirectoryMsg : public IncomingMessage
33  {
34  /// Nanoseconds portion of the timestamp
35  UInt32 nanoseconds() const
36  {
37  return ordinary<UInt32>(1);
38  }
39 
40  /// Denotes the primary identifier of an Order Book
42  {
43  return ordinary<UInt32>(5);
44  }
45 
46  /// Instrument short name
47  StrRef symbol() const
49  {
50  return fixedStr<32>(9);
51  }
52 
53  /// Human readable long name of Instrument series
54  StrRef longName() const
56  {
57  return fixedStr<32>(41);
58  }
59 
60  /// ISIN code identifying security
61  StrRef isin() const
63  {
64  return fixedStr<12>(73);
65  }
66 
67  /// Financial Product
70  {
71  return enumeration<FinancialProduct>(85);
72  }
73 
74  /// Trading Currency
77  {
78  return fixedStr<3>(86);
79  }
80 
81  /// This value defines the number of decimals used in
82  /// price for this Order Book
83  UInt16 numberOfDecimalsInPrice() const
84  {
85  return ordinary<UInt16>(89);
86  }
87 
88  /// This value defines the number of decimals in
89  /// Nominal Value
91  {
92  return ordinary<UInt16>(91);
93  }
94 
95  /// Indicates the number of securities that represent
96  /// an odd lot for the order book
97  UInt32 oddLotSize() const
98  {
99  return ordinary<UInt32>(93);
100  }
101 
102  /// Indicates the quantity that represents a round lot
103  /// for the order book.
104  UInt32 roundLotSize() const
105  {
106  return ordinary<UInt32>(97);
107  }
108 
109  /// Indicates the number of securities that represent
110  /// a block lot for the order book.
111  UInt32 blockLotSize() const
112  {
113  return ordinary<UInt32>(101);
114  }
115 
116  /// Nominal Value
117  UInt64 nominalValue() const
118  {
119  return ordinary<UInt64>(105);
120  }
121 
122  /// Number of legs.
123  UInt8 numberOfLegs() const
124  {
125  return ordinaryRef<UInt8>(113);
126  }
127 
128  /// The commodity code of the underlying instrument.
129  UInt32 commodityCode() const
130  {
131  return ordinary<UInt32>(114);
132  }
133 
134  /// Strike Price
136  {
137  return Price(ordinary<Int32>(118));
138  }
139 
140  /// Date of expiration.
142  {
143  return ordinary<UInt32>(122);
144  }
145 
146  /// This value defines the number of decimals used in
147  /// Strike Price for this order book.
149  {
150  return ordinary<UInt16>(126);
151  }
152 
153  /// Put or Call
156  {
157  return enumeration<PutOrCall>(128);
158  }
159 
160  /// Total message size.
162 
163  /// Check the given size.
164  static void validateSize(MessageSize size)
165  {
166  if(size < messageSize_)
167  throwIncorrectSize("OrderBookDirectoryMsg", size, messageSize_);
168  }
169 
170  /// Initializes instance over given memory block.
171  OrderBookDirectoryMsg(const void* data, MessageSize size)
173  : IncomingMessage(data, size)
174  {
175  }
176  };
177 
178  /// Serializes object into string.
179  ONIXS_SGXTITAN_ITCH_API void toStr(std::string&, const OrderBookDirectoryMsg&);
180 
181  /// Serializes object into string.
182  inline std::string toStr(const OrderBookDirectoryMsg& msg)
183  {
184  std::string str;
185  toStr(str, msg);
186  return str;
187  }
188 
189  ///
190  inline std::ostream& operator<<(std::ostream& stream, const OrderBookDirectoryMsg& msg)
191  {
192  stream << toStr(msg);
193  return stream;
194  }
195 
196 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
FinancialProduct::Enum financialProduct() const
Financial Product.
#define ONIXS_SGXTITAN_ITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:46
static void validateSize(MessageSize size)
Check the given size.
OrderBookDirectoryMsg(const void *data, MessageSize size)
Initializes instance over given memory block.
#define ONIXS_SGXTITAN_ITCH_NOTHROW
Definition: Compiler.h:27
StrRef isin() const
ISIN code identifying security.
UInt32 Date
Alias for Date type.
Definition: Defines.h:49
StrRef longName() const
Human readable long name of Instrument series.
UInt32 commodityCode() const
The commodity code of the underlying instrument.
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
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)
OrderBookId orderBookId() const
Denotes the primary identifier of an Order Book.
UInt32 nanoseconds() const
Nanoseconds portion of the timestamp.
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:40