OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
TradeOrderIds.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 <vector>
24
27
29
33{
34 OrderId orderId_;
35 Int32 lastQty_;
36
37public:
40 : orderId_(0), lastQty_(0)
41 {
42 }
43
46 template
47 <
48 class Entry
49 >
50 explicit
52 const Entry& entry)
53 : orderId_(
54 entry.orderId())
55 , lastQty_(
56 entry.lastQty())
57 {
58 }
59
62 {
63 return orderId_;
64 }
65
68 Int32 lastQty() const
69 {
70 return lastQty_;
71 }
72};
73
81{
82 typedef
83 std::vector<TradeOrderDetails>
84 Ids;
85
86 Ids ids_;
87
88public:
90 typedef
93
96 {
97 }
98
101 explicit
103 size_t capacity)
104 {
105 reserve(capacity);
106 }
107
110 const TradeOrderIds& other)
111 : ids_(other.ids_)
112 {
113 }
114
117 {
118 }
119
121 bool empty() const
122 {
123 return ids_.empty();
124 }
125
127 size_t size() const
128 {
129 return ids_.size();
130 }
131
133 const
134 Details&
135 operator [](
136 size_t index) const
137 {
138 assert(
139 index <
140 ids_.size());
141
142 return ids_[index];
143 }
144
146 template
147 <
148 class Entry
149 >
150 void
152 const Entry& entry)
153 {
154 ids_.push_back(Details(entry));
155 }
156
158 void clear()
159 {
160 ids_.clear();
161 }
162
166 void
168 size_t capacity)
169 {
170 ids_.reserve(capacity);
171 }
172};
173
#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
TradeOrderDetails()
Initializes blank instance with no valid attributes.
OrderId orderId() const
Returns the order identifier.
void add(const Entry &entry)
Adds order details to the collection.
size_t size() const
The number of items in the given collection.
~TradeOrderIds()
Destructs the internal storage.
bool empty() const
Indicates whether the collection of details is empty.
TradeOrderIds(const TradeOrderIds &other)
Initializes as a copy of the other instance.
TradeOrderIds()
Initializes blank instance.
TradeOrderDetails Details
Alias for the trade order details.
void clear()
Resets the collection to the blank state.
UInt64 OrderId
Type for order identification.
Definition Order.h:29
Int32 Int32
int32.
Definition Fields.h:69