OnixS C++ CME MDP Premium Market Data Handler 5.10.3
Users' manual and API documentation
Loading...
Searching...
No Matches
ImpliedPriceLevel.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <string>
24
28
30
33{
34public:
37 : exist_(false)
38 , price_()
39 , qty_(0)
40 {
41 }
42
45 : exist_(other.exist_)
46 , price_(other.price_)
47 , qty_(other.qty_)
48 {
49 }
50
54 : exist_(true)
55 , price_(price)
56 , qty_(qty)
57 {
58 }
59
62
64 bool exist() const
65 {
66 return exist_;
67 }
68
70 bool& exist()
71 {
72 return exist_;
73 }
74
84 {
85 return price_;
86 }
87
90 {
91 return price_;
92 }
93
96 {
97 return qty_;
98 }
99
102 {
103 return qty_;
104 }
105
106 // Re-initializes as copy of other instance.
108 {
109 price_ = other.price_;
110 qty_ = other.qty_;
111 exist_ = other.exist_;
112
113 return *this;
114 }
115
116private:
117 // Indicates whether data is available.
118 bool exist_;
119
120 // Price value for the level.
121 Messaging::Decimal price_;
122
123 // Quantity component.
124 MbpBookQuantity qty_;
125};
126
129void toStr(std::string&, const ImpliedPriceLevel&);
130
132inline std::string toStr(const ImpliedPriceLevel& priceLevel)
133{
134 std::string str;
135
136 toStr(str, priceLevel);
137
138 return str;
139}
140
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:54
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:55
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:148
Encapsulates price level concept.
ImpliedPriceLevel()
Initializes undefined level.
Messaging::Decimal & price()
Price value.
MbpBookQuantity & quantity()
Quantity for the given price.
~ImpliedPriceLevel()
Cleans everything up.
ImpliedPriceLevel(const Messaging::Decimal &price, MbpBookQuantity qty)
bool exist() const
Identifies whether price level exist.
ImpliedPriceLevel & operator=(const ImpliedPriceLevel &other)
bool & exist()
Updates existence status.
const Messaging::Decimal & price() const
ImpliedPriceLevel(const ImpliedPriceLevel &other)
Initializes as copy of other level.
MbpBookQuantity quantity() const
Quantity for the given price.
FloatingPointDecimal< DecimalMantissa, DecimalExponent > Decimal
Universal decimal type.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Messaging::Int64 MbpBookQuantity
Type for order Quantity.