OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.0
API documentation
OpenInterest.h
Go to the documentation of this file.
1 /**
2  * \file
3  * \brief Declare `OnixS::ICE::iMpact::MarketData::OpenInterest` message structure
4  */
5 /*
6  * Copyright (c) Onix Solutions Limited. All rights reserved.
7  *
8  * This software owned by Onix Solutions Limited and is protected by copyright law
9  * and international copyright treaties.
10  *
11  * Access to and use of the software is governed by the terms of the applicable ONIXS Software
12  * Services Agreement (the Agreement) and Customer end user license agreements granting
13  * a non-assignable, non-transferable and non-exclusive license to use the software
14  * for it's own data processing purposes under the terms defined in the Agreement.
15  *
16  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
17  * of this source code or associated reference material to any other location for further reproduction
18  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
19  *
20  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
21  * the terms of the Agreement is a violation of copyright law.
22  */
23 
24 #pragma once
25 
26 #include "../Export.h"
27 #include "../Types.h"
28 
29 #include <iosfwd>
30 #include <string>
31 
32 namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
33 
34 /// This class represents the Open Interest Message.
35 struct ONIXS_ICEMDH_EXPORT OpenInterest
36 {
37  /// Message type constant
38  enum
39  {
40  messageType = 'M'
41  };
42 
43  /// Unique identifier of the market.
45 
46  /// The number of open contracts of derivatives like futures and options
47  /// that have a time limit after which they expire. Open interest in a
48  /// derivative is the sum of all contracts that have not expired, been
49  /// exercised or physically delivered. Moreover, the open interest is the
50  /// number of long positions or, equivalently, the number of short
51  /// positions.
53 
54  /// The change in the number of contracts that are remaining open and
55  /// still working in the market. This is the change compared to the
56  /// previous trading day open interest.
58 
59  /// Date time the message was sent. Milliseconds since Jan 1st, 1970,
60  /// 00:00:00 GMT
62 
63  /// The date this Open Interest is effective for, in the format of YYYY-
64  /// MM-DD.
65  std::string openInterestDate;
66 
67  /// Default constructor.
68  OpenInterest();
69 
70  /// Initialize from raw message data.
71  OpenInterest(const char* data, std::size_t dataSize);
72 
73  /// Deserialize from raw data.
74  void deserialize(const char* data, std::size_t dataSize);
75 
76  /// Reset all fields to default values.
77  void reset();
78 
79  /// Returns string representation.
80  std::string toString() const;
81 };
82 
83 /// Make it printable using C++ I/O streams.
84 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const OpenInterest&);
85 
86 }}}} // namespace OnixS::ICE::iMpact::MarketData
int MarketId
Alias for market identifiers type.
Definition: Types.h:39
This class represents the Open Interest Message.
Definition: OpenInterest.h:35
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
MarketId marketId
Unique identifier of the market.
Definition: OpenInterest.h:44
long long DateTime
Represents the number of nanoseconds since Jan 1st, 1970, 00:00:00 GMT.
Definition: Types.h:57