OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
DirectPriceLevel.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
24
26
30{
31 // Indicates whether data is available.
32 bool exist_;
33
34 // Price value for the level.
35 Decimal price_;
36
37 // Quantity component.
38 Int64 qty_;
39
40 // Number of orders.
41 Int32 ordersQty_;
42
43public:
46 : exist_(false)
47 , price_()
48 , qty_(0)
49 , ordersQty_(0)
50 {
51 }
52
55 const DirectPriceLevel& other)
56 : exist_(other.exist_)
57 , price_(other.price_)
58 , qty_(other.qty_)
59 , ordersQty_(other.ordersQty_)
60 {
61 }
62
66 const Decimal& price,
67 Int32 qty,
68 Int32 ordersQty)
69 : exist_(true),
70 price_(price),
71 qty_(qty)
72 , ordersQty_(ordersQty)
73 {
74 }
75
76 // Actually, does nothing.
78 {
79 }
80
82 bool exist() const
83 {
84 return exist_;
85 }
86
88 bool& exist()
89 {
90 return exist_;
91 }
92
101 const Decimal& price() const
102 {
103 return price_;
104 }
105
108 {
109 return price_;
110 }
111
113 Int64 quantity() const
114 {
115 return qty_;
116 }
117
119 Int64& quantity()
120 {
121 return qty_;
122 }
123
126 {
127 return ordersQty_;
128 }
129
132 {
133 return ordersQty_;
134 }
135
138 operator =(
139 const DirectPriceLevel& other)
140 {
141 price_ = other.price_;
142 qty_ = other.qty_;
143 exist_ = other.exist_;
144 ordersQty_ = other.ordersQty_;
145
146 return *this;
147 }
148};
149
151ONIXS_CONFLATEDUDP_EXPORTED
152void
154 std::string&,
155 const DirectPriceLevel&);
156
158inline
159std::string
161 const DirectPriceLevel& priceLevel)
162{
163 std::string str;
164
165 toStr(str, priceLevel);
166
167 return str;
168}
169
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
A real number with floating exponent.
Definition Decimal.h:232
Encapsulates price level concept.
DirectPriceLevel(const Decimal &price, Int32 qty, Int32 ordersQty)
bool exist() const
Identifies whether price level exist.
Int64 quantity() const
Quantify for the given price.
DirectPriceLevel(const DirectPriceLevel &other)
Initializes as copy of other level.
Int32 numberOfOrders() const
Total number of orders of given price.
Int64 & quantity()
Quantify for the given price.
DirectPriceLevel()
Initializes undefined level.
bool & exist()
Updates existence status.
Int32 & numberOfOrders()
Updates total number of orders.
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Int32 Int32
int32.
Definition Fields.h:69