OnixS C++ CME MDP Premium Market Data Handler 5.9.0
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
39{
41 static OrderId nullId()
42 {
43 return 18446744073709551615ul;
44 }
45
48 {
49 return 18446744073709551615ul;
50 }
51
53 static Int64 nullPriceMantissa()
54 {
55 return 9223372036854775807l;
56 }
57
59 static bool nullPrice(const Decimal& price)
60 {
61 return (price.mantissa() == nullPriceMantissa());
62 }
63
66 {
67 return 2147483647;
68 }
69};
70
73{
74public:
77 : id_(OrderTraits::nullId())
78 , priority_(OrderTraits::nullPriority())
79 , price_(OrderTraits::nullPriceMantissa(), 0)
80 , quantity_(OrderTraits::nullQuantity())
81 {
82 }
83
92
94 OrderId id() const
95 {
96 return id_;
97 }
98
100 void id(OrderId id)
101 {
102 id_ = id;
103 }
104
107 {
108 return priority_;
109 }
110
116
118 const Decimal& price() const
119 {
120 return price_;
121 }
122
124 void price(const Decimal& price)
125 {
126 price_ = price;
127 }
128
131 {
132 return quantity_;
133 }
134
140
141protected:
144
147};
148
151void toStr(std::string&, const Order&);
152
154inline std::string toStr(const Order& order)
155{
156 std::string str;
157
158 toStr(str, order);
159
160 return str;
161}
162
#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
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition Decimal.h:176
Order as the member of the Market By Order (MBO) book.
Definition Order.h:73
DisplayQuantity quantity_
Definition Order.h:146
Order(OrderId id, OrderPriority priority, const Decimal &price, DisplayQuantity quantity)
Initializes instance according to given values.
Definition Order.h:85
const Decimal & price() const
Order price.
Definition Order.h:118
DisplayQuantity quantity() const
Display quantity.
Definition Order.h:130
void id(OrderId id)
Updates order identifier.
Definition Order.h:100
void priority(OrderPriority priority)
Updates order priority.
Definition Order.h:112
OrderPriority priority_
Definition Order.h:143
OrderPriority priority() const
Order priority.
Definition Order.h:106
void quantity(DisplayQuantity quantity)
Updates display quantity.
Definition Order.h:136
OrderId id() const
Order identifier.
Definition Order.h:94
Order()
Initializes blank/null instance.
Definition Order.h:76
void price(const Decimal &price)
Updates order price.
Definition Order.h:124
UInt64 OrderId
Type for order identification.
Definition Order.h:29
UInt64 UInt64
uInt64.
Definition Fields.h:205
Int32 Int32
int32.
Definition Fields.h:60
Int32 DisplayQuantity
Presents display quantity.
Definition Order.h:35
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
UInt64 OrderPriority
Type for order priority.
Definition Order.h:32
Some basic traits for the order.
Definition Order.h:39
static Int64 nullPriceMantissa()
Returns mantissa of the null price.
Definition Order.h:53
static bool nullPrice(const Decimal &price)
Returns mantissa of the null price.
Definition Order.h:59
static OrderPriority nullPriority()
Returns null order priority.
Definition Order.h:47
static DisplayQuantity nullQuantity()
Returns null display quantity.
Definition Order.h:65
static OrderId nullId()
Returns null order id.
Definition Order.h:41