OnixS C++ CME MDP Premium Market Data Handler 5.10.3
Users' manual and 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
26
28
31
34
37
40{
42 static OrderId nullId()
43 {
44 return 18446744073709551615ul;
45 }
46
49 {
50 return 18446744073709551615ul;
51 }
52
55 {
56 return 9223372036854775807l;
57 }
58
60 static bool nullPrice(const Messaging::Decimal& price)
61 {
62 return (price.mantissa() == nullPriceMantissa());
63 }
64
67 {
68 return 2147483647;
69 }
70};
71
74{
75public:
78 : id_(OrderTraits::nullId())
79 , priority_(OrderTraits::nullPriority())
80 , price_(OrderTraits::nullPriceMantissa(), 0)
81 , quantity_(OrderTraits::nullQuantity())
82 {
83 }
84
93
95 OrderId id() const
96 {
97 return id_;
98 }
99
101 void id(OrderId id)
102 {
103 id_ = id;
104 }
105
108 {
109 return priority_;
110 }
111
117
120 {
121 return price_;
122 }
123
126 {
127 price_ = price;
128 }
129
132 {
133 return quantity_;
134 }
135
141
142protected:
145
148};
149
152void toStr(std::string&, const Order&);
153
155inline std::string toStr(const Order& order)
156{
157 std::string str;
158
159 toStr(str, order);
160
161 return str;
162}
163
#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
Order as the member of the Market By Order (MBO) book.
Definition Order.h:74
Order(OrderId id, OrderPriority priority, const Messaging::Decimal &price, DisplayQuantity quantity)
Initializes instance according to given values.
Definition Order.h:86
DisplayQuantity quantity_
Definition Order.h:147
DisplayQuantity quantity() const
Display quantity.
Definition Order.h:131
void id(OrderId id)
Updates order identifier.
Definition Order.h:101
void priority(OrderPriority priority)
Updates order priority.
Definition Order.h:113
OrderPriority priority_
Definition Order.h:144
OrderPriority priority() const
Order priority.
Definition Order.h:107
void price(const Messaging::Decimal &price)
Updates order price.
Definition Order.h:125
void quantity(DisplayQuantity quantity)
Updates display quantity.
Definition Order.h:137
OrderId id() const
Order identifier.
Definition Order.h:95
const Messaging::Decimal & price() const
Order price.
Definition Order.h:119
Messaging::Decimal price_
Definition Order.h:146
Order()
Initializes blank/null instance.
Definition Order.h:77
std::int32_t Int32
int32.
Definition Integral.h:34
FloatingPointDecimal< DecimalMantissa, DecimalExponent > Decimal
Universal decimal type.
std::uint64_t UInt64
uInt64.
Definition Integral.h:37
Messaging::Int32 DisplayQuantity
Presents display quantity.
Definition Order.h:36
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Messaging::UInt64 OrderPriority
Type for order priority.
Definition Order.h:33
Messaging::UInt64 OrderId
Type for order identification.
Definition Order.h:30
Some basic traits for the order.
Definition Order.h:40
static bool nullPrice(const Messaging::Decimal &price)
Returns mantissa of the null price.
Definition Order.h:60
static OrderPriority nullPriority()
Returns null order priority.
Definition Order.h:48
static Messaging::Int64 nullPriceMantissa()
Returns mantissa of the null price.
Definition Order.h:54
static DisplayQuantity nullQuantity()
Returns null display quantity.
Definition Order.h:66
static OrderId nullId()
Returns null order id.
Definition Order.h:42