OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
Order.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
25
27
30
33
36
40{
42 static OrderId nullId()
43 {
44 return 18446744073709551615ul;
45 }
46
49 {
50 return 18446744073709551615ul;
51 }
52
54 static Int64 nullPriceMantissa()
55 {
56 return 9223372036854775807l;
57 }
58
60 static
61 bool
63 const Decimal& price)
64 {
65 return (
66 price.mantissa() ==
68 );
69 }
70
73 {
74 return 2147483647;
75 }
76};
77
80{
81protected:
84
87
88public:
91 : id_(
92 OrderTraits::nullId())
93 , priority_(
94 OrderTraits::nullPriority())
95 , price_(
96 OrderTraits::nullPriceMantissa(),
97 0)
98 , quantity_(
99 OrderTraits::nullQuantity())
100 {
101 }
102
105 OrderId id,
107 const Decimal& price,
109 : id_(id)
111 , price_(price)
113 {
114 }
115
117 OrderId id() const
118 {
119 return id_;
120 }
121
123 void
125 OrderId id)
126 {
127 id_ = id;
128 }
129
132 {
133 return priority_;
134 }
135
137 void
143
145 const Decimal& price() const
146 {
147 return price_;
148 }
149
151 void
153 const Decimal& price)
154 {
155 price_ = price;
156 }
157
160 {
161 return quantity_;
162 }
163
165 void
171};
172
174ONIXS_CONFLATEDUDP_EXPORTED
175void
177 std::string&,
178 const Order&);
179
181inline
182std::string
184 const Order& order)
185{
186 std::string str;
187
188 toStr(str, order);
189
190 return str;
191}
192
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
Definition Bootstrap.h:99
#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
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition Decimal.h:290
Order as the member of the Market By Order (MBO) book.
Definition Order.h:80
DisplayQuantity quantity_
Definition Order.h:86
Order(OrderId id, OrderPriority priority, const Decimal &price, DisplayQuantity quantity)
Initializes instance according to given values.
Definition Order.h:104
const Decimal & price() const
Order price.
Definition Order.h:145
DisplayQuantity quantity() const
Display quantity.
Definition Order.h:159
void id(OrderId id)
Updates order identifier.
Definition Order.h:124
void priority(OrderPriority priority)
Updates order priority.
Definition Order.h:138
OrderPriority priority() const
Order priority.
Definition Order.h:131
void quantity(DisplayQuantity quantity)
Updates display quantity.
Definition Order.h:166
OrderId id() const
Order identifier.
Definition Order.h:117
Order()
Initializes blank/null instance.
Definition Order.h:90
void price(const Decimal &price)
Updates order price.
Definition Order.h:152
UInt64 OrderId
Type for order identification.
Definition Order.h:29
UInt64 UInt64
uInt64.
Definition Fields.h:265
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Int32 Int32
int32.
Definition Fields.h:69
Int32 DisplayQuantity
Presents display quantity.
Definition Order.h:35
UInt64 OrderPriority
Type for order priority.
Definition Order.h:32
Some basic traits for the order.
Definition Order.h:40
static Int64 nullPriceMantissa()
Returns mantissa of the null price.
Definition Order.h:54
static bool nullPrice(const Decimal &price)
Returns mantissa of the null price.
Definition Order.h:62
static OrderPriority nullPriority()
Returns null order priority.
Definition Order.h:48
static DisplayQuantity nullQuantity()
Returns null display quantity.
Definition Order.h:72
static OrderId nullId()
Returns null order id.
Definition Order.h:42