OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
Trade.cpp
Go to the documentation of this file.
1 /*
2 * Copyright 2002-2010 ONIX SOLUTIONS LIMITED. 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 
22 
23 #include "Utils.h"
24 
25 using namespace std;
26 using namespace OnixS::Eurex::MarketData;
27 
28 SnapshotTrade::SnapshotTrade(
29  SecurityId id,
30  UInt32 sequenceNumber,
31  const MDSnapshotEntry& tradeEntry)
32  : Trade<MDSnapshotEntry>(id, sequenceNumber, tradeEntry)
33  , impl_(nullptr)
34 {
35 }
36 
37 void SnapshotTrade::toString(string& presentation) const
38 {
39  presentation
40  << "SnapshotTrade "
41  << "[securityId=" << securityId()
42  << ", type=" << TrdType::toString(type())
43  << ", condition=" << condition().toString();
44 
45  Decimal tradeVolume;
46  if(volume(tradeVolume))
47  presentation << ", volume=" << tradeVolume.toString();
48 
49  Decimal priceValue;
50  if(price(priceValue))
51  presentation << ", price=" << priceValue.toString();
52 
53  presentation << ']';
54 
55 }
56 
58  SecurityId id,
60  const MDIncrementalEntry& tradeEntry)
61  : Trade<MDIncrementalEntry>(id, sequenceNumber, tradeEntry)
62  , impl_(nullptr)
63 {
64 }
65 
67 {
68  UInt32 id = 0;
70  return id;
71 }
72 
73 void IncrementalTrade::toString(string& presentation) const
74 {
75  presentation
76  << "IncrementalTrade "
77  << "[securityId=" << securityId()
78  << ", type=" << TrdType::toString(type())
79  << ", condition=" << condition().toString();
80 
81  Decimal tradeVolume;
82  if(volume(tradeVolume))
83  presentation << ", volume=" << tradeVolume.toString();
84 
85  Decimal priceValue;
86  if(price(priceValue))
87  presentation << ", price=" << priceValue.toString();
88 
89  presentation << ']';
90 }
91 
92 
STL namespace.
IncrementalTrade(SecurityId id, UInt32 sequenceNumber, const MDIncrementalEntry &tradeEntry)
Initializes an instance.
Definition: Trade.cpp:57
unsigned int UInt32
Definition: Numeric.h:41
Decimal type for better precision.
Definition: Numeric.h:63
UInt32 sequenceNumber() const
Sequence number of the last processed message.
Definition: Trade.h:79
std::string toString() const
Returns text presentation.
Int64 SecurityId
Alias for Security Id type.
Definition: Defines.h:51
bool price(Decimal &value) const
Trade price.
Definition: Trade.h:66
static std::string toString(Enum value)
Definition: Defines.cpp:30
UInt32 entryId() const
MDEntryID.
Definition: Trade.cpp:66
void toString(std::string &) const
Appends text presentation to given string.
Definition: Decimal.cpp:217
TradeConditionSet condition() const
Defines the trade condition.
Definition: Trade.h:54
bool volume(Decimal &value) const
Trade volume.
Definition: Trade.h:60
Market data snapshot entry.
Definition: DepthSnapshot.h:51
const MDIncrementalEntry & underlyingEntry() const
Definition: Trade.h:73