OnixS C++ CME MDP Premium Market Data Handler 5.9.0
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
27
29
32{
33public:
36 : exist_(false)
37 , price_()
38 , qty_(0)
39 {
40 }
41
44 : exist_(other.exist_)
45 , price_(other.price_)
46 , qty_(other.qty_)
47 {
48 }
49
53 : exist_(true)
54 , price_(price)
55 , qty_(qty)
56 {
57 }
58
61
63 bool exist() const
64 {
65 return exist_;
66 }
67
69 bool& exist()
70 {
71 return exist_;
72 }
73
82 const Decimal& price() const
83 {
84 return price_;
85 }
86
89 {
90 return price_;
91 }
92
95 {
96 return qty_;
97 }
98
101 {
102 return qty_;
103 }
104
105 // Re-initializes as copy of other instance.
107 {
108 price_ = other.price_;
109 qty_ = other.qty_;
110 exist_ = other.exist_;
111
112 return *this;
113 }
114
115private:
116 // Indicates whether data is available.
117 bool exist_;
118
119 // Price value for the level.
120 Decimal price_;
121
122 // Quantity component.
123 MbpBookQuantity qty_;
124};
125
128void toStr(std::string&, const ImpliedPriceLevel&);
129
131inline std::string toStr(const ImpliedPriceLevel& priceLevel)
132{
133 std::string str;
134
135 toStr(str, priceLevel);
136
137 return str;
138}
139
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:67
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:68
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:171
A real number with floating exponent.
Definition Decimal.h:137
Encapsulates price level concept.
ImpliedPriceLevel()
Initializes undefined level.
MbpBookQuantity & quantity()
Quantity for the given price.
~ImpliedPriceLevel()
Cleans everything up.
bool exist() const
Identifies whether price level exist.
const Decimal & price() const
Price value.
ImpliedPriceLevel(const Decimal &price, MbpBookQuantity qty)
Initializes defined level according to specified attributes.
ImpliedPriceLevel & operator=(const ImpliedPriceLevel &other)
bool & exist()
Updates existence status.
ImpliedPriceLevel(const ImpliedPriceLevel &other)
Initializes as copy of other level.
MbpBookQuantity quantity() const
Quantity for the given price.
Int64 MbpBookQuantity
Type for order Quantity.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.