OnixS C++ CME MDP Premium Market Data Handler 5.11.1
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
35{
36public:
38 constexpr ImpliedPriceLevel() noexcept = default;
39
42 constexpr ImpliedPriceLevel(const ImpliedPriceLevel& other) noexcept = default;
43
46 constexpr ImpliedPriceLevel(ImpliedPriceLevel&& other) noexcept = default;
47
51 constexpr ImpliedPriceLevel(const Messaging::Decimal& price, MbpBookQuantity qty) noexcept
52 : exist_(true)
53 , price_(price)
54 , qty_(qty)
55 {
56 }
57
59 ~ImpliedPriceLevel() = default;
60
64 constexpr bool exist() const noexcept
65 {
66 return exist_;
67 }
68
72 bool& exist() noexcept
73 {
74 return exist_;
75 }
76
88 constexpr const Messaging::Decimal& price() const noexcept
89 {
90 return price_;
91 }
92
100 {
101 return price_;
102 }
103
110 constexpr MbpBookQuantity quantity() const noexcept
111 {
112 return qty_;
113 }
114
122 {
123 return qty_;
124 }
125
129 ImpliedPriceLevel& operator=(const ImpliedPriceLevel& other) noexcept = default;
130
134 ImpliedPriceLevel& operator=(ImpliedPriceLevel&& other) noexcept = default;
135
136private:
137 // Indicates whether data is available.
138 bool exist_{false};
139
140 // Price value for the level.
141 Messaging::Decimal price_{};
142
143 // Quantity component.
144 MbpBookQuantity qty_{0};
145};
146
151void toStr(std::string& str, const ImpliedPriceLevel& priceLevel);
152
156inline ONIXS_CMEMDH_NODISCARD std::string toStr(const ImpliedPriceLevel& priceLevel)
157{
158 std::string str;
159
160 toStr(str, priceLevel);
161
162 return str;
163}
164
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:69
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:61
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
#define ONIXS_CMEMDH_NODISCARD
Definition Compiler.h:165
Represents one implied book price level.
constexpr bool exist() const noexcept
Checks whether the price level is present in the book.
MbpBookQuantity & quantity() noexcept
Provides mutable access to the aggregate quantity.
~ImpliedPriceLevel()=default
Destroys the price level.
constexpr MbpBookQuantity quantity() const noexcept
Gets the aggregate quantity at the price level.
ImpliedPriceLevel & operator=(const ImpliedPriceLevel &other) noexcept=default
Replaces this price level with a copy of another instance.
ImpliedPriceLevel & operator=(ImpliedPriceLevel &&other) noexcept=default
Replaces this price level by moving another instance.
constexpr const Messaging::Decimal & price() const noexcept
Gets the price value.
bool & exist() noexcept
Provides mutable access to the presence flag.
Messaging::Decimal & price() noexcept
Provides mutable access to the price value.
constexpr ImpliedPriceLevel() noexcept=default
Constructs an absent price level.
FloatingPointDecimal< DecimalMantissa, DecimalExponent > Decimal
Universal decimal type.
Messaging::Int64 MbpBookQuantity
Represents an aggregate quantity at a market-by-price level.
void toStr(std::string &str, BookState::Enum bookState)
Appends a string representation of a book state.