OnixS C++ CME MDP Premium Market Data Handler 5.9.0
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
25#include <OnixS/CME/MDH/Order.h>
27
29
33{
34public:
37 : orderId_(0)
38 , lastQty_(0)
39 {
40 }
41
44 template <class Entry>
45 explicit TradeOrderDetails(const Entry& entry)
46 : orderId_(entry.orderId())
47 , lastQty_(entry.lastQty())
48 {
49 }
50
53 {
54 return orderId_;
55 }
56
59 Int32 lastQty() const
60 {
61 return lastQty_;
62 }
63
64private:
65 OrderId orderId_;
66 Int32 lastQty_;
67};
68
76{
77public:
80
83
86 explicit TradeOrderIds(size_t capacity)
87 {
88 reserve(capacity);
89 }
90
93 : ids_(other.ids_)
94 {
95 }
96
99
101 bool empty() const
102 {
103 return ids_.empty();
104 }
105
107 size_t size() const
108 {
109 return ids_.size();
110 }
111
113 const Details& operator[](size_t index) const
114 {
115 assert(index < ids_.size());
116
117 return ids_[index];
118 }
119
121 template <class Entry>
122 void add(const Entry& entry)
123 {
124 ids_.push_back(Details(entry));
125 }
126
128 void clear()
129 {
130 ids_.clear();
131 }
132
136 void reserve(size_t capacity)
137 {
138 ids_.reserve(capacity);
139 }
140
141private:
142 typedef std::vector<TradeOrderDetails> Ids;
143
144 Ids ids_;
145};
146
#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
Stores information on a trade order like the order identifier and the other details.
TradeOrderDetails()
Initializes blank instance with no valid attributes.
Int32 lastQty() const
Returns last quantity for the order referenced by the trade.
OrderId orderId() const
Returns the order identifier.
TradeOrderDetails(const Entry &entry)
Retrieves order details from the given market data entry.
void reserve(size_t capacity)
Makes the collection capacious enough to store the given number of items without allocating additiona...
void add(const Entry &entry)
Adds order details to the collection.
size_t size() const
The number of items in the given collection.
TradeOrderIds(size_t capacity)
Initializes the blank instance capacious enough to store the given number of orders.
~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.
const Details & operator[](size_t index) const
Provides access to an item by its index.
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:60