OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers 18.2.0
API documentation
Loading...
Searching...
No Matches
Trade.h
Go to the documentation of this file.
1/*
2* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3*
4* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5* and international copyright treaties.
6*
7* Access to and use of the software is governed by the terms of the applicable OnixS Software
8* Services Agreement (the Agreement) and Customer end user license agreements granting
9* a non-assignable, non-transferable and non-exclusive license to use the software
10* for it's own data processing purposes under the terms defined in the Agreement.
11*
12* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13* of this source code or associated reference material to any other location for further reproduction
14* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15*
16* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17* the terms of the Agreement is a violation of copyright law.
18*/
19
20#pragma once
21
26
27namespace OnixS
28{
29 namespace Eurex
30 {
31 namespace MarketData
32 {
34 template< class TTradeEntry >
35 class Trade
36 {
37 public:
39 Trade (SecurityId id, UInt32 sequenceNumber, const TTradeEntry& tradeEntry);
40
44
49 {
50 return tradeEntry_.trdType();
51 }
52
55 {
56 return tradeEntry_.tradeCondition();
57 }
58
60 bool volume (Decimal& value) const
61 {
62 return tradeEntry_.mdEntrySize (value);
63 }
64
66 bool price (Decimal& value) const
67 {
68 return tradeEntry_.mdEntryPx (value);
69 }
70
73 const TTradeEntry& underlyingEntry() const
74 {
75 return tradeEntry_;
76 }
77
80 {
81 return sequenceNumber_;
82 }
83
85 UInt32 size() const;
86
88 std::string toString() const;
89
91 virtual void toString (std::string&) const = 0;
92
93 virtual ~Trade() { }
94
95 protected:
98
99 // Underlying trade entry.
100 const TTradeEntry& tradeEntry_;
101 };
102
103 template< class TTradeEntry >
107 , tradeEntry_ (tradeEntry)
108 {
109 }
110
111 template< class TTradeEntry >
116
117 template< class TTradeEntry >
119 {
121 tradeEntry_.mdEntrySize (size);
122 return size;
123 }
124
125 template< class TTradeEntry >
127 {
128 std::string str;
129
130 toString (str);
131
132 return str;
133 }
134
136 class ONIXS_EUREX_EMDI_API SnapshotTrade : public Trade<MDSnapshotEntry>
137 {
138 public:
140 void toString (std::string&) const ONIXS_EUREX_EMDI_OVERRIDE;
141
142 protected:
145
146 private:
149
151 SnapshotTrade& operator = (const SnapshotTrade&);
152
153 // Underlying implementation.
154 void* impl_;
155 };
156
158 class ONIXS_EUREX_EMDI_API IncrementalTrade : public Trade<MDIncrementalEntry>
159 {
160 public:
163
165 void toString (std::string&) const ONIXS_EUREX_EMDI_OVERRIDE;
166
167 protected:
170
171 private:
174
176 IncrementalTrade& operator = (const IncrementalTrade&);
177
178 // Underlying implementation.
179 void* impl_;
180 };
181 }
182 }
183}
#define ONIXS_EUREX_EMDI_OVERRIDE
Definition Compiler.h:134
Decimal type for better precision.
Definition Numeric.h:66
IncrementalTrade(SecurityId id, UInt32 sequenceNumber, const MDIncrementalEntry &tradeEntry)
Initializes an instance.
void toString(std::string &) const ONIXS_EUREX_EMDI_OVERRIDE
Appends text presentation.
void toString(std::string &) const ONIXS_EUREX_EMDI_OVERRIDE
Appends text presentation.
SnapshotTrade(SecurityId id, UInt32 sequenceNumber, const MDSnapshotEntry &tradeEntry)
Initializes an instance.
std::string toString() const
Returns text presentation.
Definition Trade.h:126
UInt32 size() const
Underlying entry size.
Definition Trade.h:118
TrdType::Enum type() const
Definition Trade.h:48
Trade(SecurityId id, UInt32 sequenceNumber, const TTradeEntry &tradeEntry)
Initializes an instance.
Definition Trade.h:104
virtual void toString(std::string &) const =0
Appends text presentation.
TradeConditionSet condition() const
Defines the trade condition.
Definition Trade.h:54
const TTradeEntry & underlyingEntry() const
Definition Trade.h:73
const TTradeEntry & tradeEntry_
Definition Trade.h:100
SecurityId securityId() const
Definition Trade.h:112
bool volume(Decimal &value) const
Trade volume.
Definition Trade.h:60
bool price(Decimal &value) const
Trade price.
Definition Trade.h:66
unsigned int UInt32
Definition Numeric.h:41
Int64 SecurityId
Alias for Security Id type.
Definition Defines.h:51