OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.3
API documentation
AddComplexInstrument.cpp
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 #include <boost/current_function.hpp>
20 
23 
24 #include "MessageDataStructures.h"
25 #include "../Utils.h"
26 
27 namespace OnixS{
28 namespace Eurex{
29 namespace MarketData{
30 namespace EOBI{
31 
34 
35 AddComplexInstrumentEntry::AddComplexInstrumentEntry(const void *data)
36  : DataContainer(data)
37 {
38 }
39 
41 {
42  return (getData<AddComplexInstrumentEntryMsgData>())->LegSymbol;
43 }
44 
46 {
47  return (getData<AddComplexInstrumentEntryMsgData>())->LegSecurityID;
48 }
49 
51 {
52  const AddComplexInstrumentEntryMsgData* msgData = getData<AddComplexInstrumentEntryMsgData>();
53 
55  return false;
56 
57  value = Decimal(msgData->LegPrice/100000000.0, 8u);
58  return true;
59 }
60 
62 {
63  return static_cast<EOBI::LegSecurityType::Enum>((getData<AddComplexInstrumentEntryMsgData>())->LegSide);
64 }
65 
67 {
68  return (getData<AddComplexInstrumentEntryMsgData>())->LegRatioQty;
69 }
70 
72 {
73  return static_cast<EOBI::LegSide::Enum>((getData<AddComplexInstrumentEntryMsgData>())->LegSide);
74 }
75 
76 void AddComplexInstrumentEntry::toString(std::string& presentation) const
77 {
78  presentation
79  << "AddComplexInstrumentEntry ["
80  << "LegSymbol=" << legSymbol()
81  << ", LegSecurityID=" << legSecurityID();
82 
83  Decimal legPriceValue;
84  if(legPrice(legPriceValue))
85  presentation << ", legPrice=" << legPriceValue.toString();
86 
87  presentation
88  << ", LegRatioQty=" << legRatioQty()
89  << ", legSecurityType=" << LegSecurityType::toString(legSecurityType())
90  << ", LegSide=" << LegSide::toString(legSide());
91 
92  presentation << ']';
93 }
94 
95 AddComplexInstrumentEntries::AddComplexInstrumentEntries(const void *data)
96  : DataContainer(data)
97 {
98 }
99 
101 {
102  return (getData<AddComplexInstrumentMsgData>())->NoLegs;
103 }
104 
106 {
107  if (idx >= size())
108  {
109  throw OperationException(BOOST_CURRENT_FUNCTION, "Invalid entry index passed.");
110  }
111 
112  const AddComplexInstrumentMsgData *msg = getData<AddComplexInstrumentMsgData>();
113  const AddComplexInstrumentEntryMsgData *group = msg->InstrmtLegGrp;
114 
115  return AddComplexInstrumentEntry(group + idx);
116 }
117 
118 void AddComplexInstrumentEntries::toString(std::string& presentation) const
119 {
120  presentation
121  << "AddComplexInstrumentEntries (" << size() << ") [";
122 
123  for (size_t i = 0; i < size(); ++i)
124  {
125  (*this)[i].toString(presentation);
126  }
127 
128  presentation << ']';
129 }
130 
131 std::string AddComplexInstrument::msgType() const
132 {
133  return std::string("BP", 2); // implied constant
134 }
135 
137 {
138  return EOBI::SecurityUpdateAction::Add; // implied constant
139 }
140 
142 {
143  return EOBI::SecurityIDSource::Marketplace; // implied constant
144 }
145 
147 {
148  return EOBI::LegSecurityIDSource::Marketplace; // implied constant
149 }
150 
152 {
153  return EOBI::NoMarketSegments::One; // implied constant
154 }
155 
157 {
158  return EOBI::SecurityType::MultiLeg; // implied constant
159 }
160 
162 {
163  return (getData<AddComplexInstrumentMsgData>())->SecurityID;
164 }
165 
167 {
168  return (getData<AddComplexInstrumentMsgData>())->TransactTime;
169 }
170 
172 {
173  return (getData<AddComplexInstrumentMsgData>())->SecuritySubType;
174 }
175 
177 {
178  return static_cast<EOBI::ProductComplex::Enum>((getData<AddComplexInstrumentMsgData>())->ProductComplex);
179 }
180 
182 {
183  return static_cast<EOBI::ImpliedMarketIndicator::Enum>((getData<AddComplexInstrumentMsgData>())->ImpliedMarketIndicator);
184 }
185 
187 {
188  return (getData<AddComplexInstrumentMsgData>())->NoLegs;
189 }
190 
192 {
193  return AddComplexInstrumentEntries(getData<AddComplexInstrumentMsgData>());
194 }
195 
196 void AddComplexInstrument::toString(std::string& presentation) const
197 {
198  presentation
199  << "AddComplexInstrument [msgSeqNum=" << msgSeqNum()
200  << ", SecurityId=" << securityID()
201  << ", TransactTime=" << transactTime()
202  << ", SecuritySubType=" << securitySubType()
203  << ", ProductComplex=" << ProductComplex::toString(productComplex())
204  << ", ImpliedMarketIndicator=" << ImpliedMarketIndicator::toString(impliedMarketIndicator())
205  << ", NoLegs=" << noLegs();
206 
207  presentation << ", InstrmtLegGrp=" ;
208  instrmtLegGrp().toString(presentation);
209 
210  presentation << ']';
211 }
212 
213 }}}}
unsigned char UInt8
Definition: Numeric.h:35
UInt64 transactTime() const
Transaction timestamp.
UInt64 securityID() const
Unique instrument identifier.
std::string toString() const
Returns text presentation.
Definition: MessageBase.cpp:37
EOBI::SecurityType::Enum securityType() const
Security type.
void toString(std::string &) const
Appends text presentation.
EOBI::NoMarketSegments::Enum noMarketSegments() const
Number of market segments.
void toString(std::string &) const
Appends text presentation.
unsigned int UInt32
Definition: Numeric.h:41
EOBI::SecurityUpdateAction::Enum securityUpdateAction() const
Security update action.
Definition: Defines.h:30
Decimal type for better precision.
Definition: Numeric.h:63
AddComplexInstrumentEntry operator[](size_t idx) const
Entry accessor.
static std::string toString(Enum value)
Definition: Defines.cpp:178
EOBI::SecurityIDSource::Enum securityIDSource() const
Marketplace assigned identifier.
static std::string toString(Enum value)
Definition: Defines.cpp:650
EOBI::ImpliedMarketIndicator::Enum impliedMarketIndicator() const
UInt64 legSecurityID() const
Instrument identifier of the leg security.
void toString(std::string &) const
Appends text presentation to given string.
Definition: Decimal.cpp:217
AddComplexInstrumentEntries instrmtLegGrp() const
Variable size array, record counter: NoLegs.
static std::string toString(Enum value)
Definition: Defines.cpp:467
EOBI::ProductComplex::Enum productComplex() const
This field qualifies an instrument type on Eurex.
EOBI::Implementation::AddComplexInstrumentMsgData AddComplexInstrumentMsgData
UInt32 legRatioQty() const
The ratio of quantity for this individual leg relative to the entire multi-leg security.
EOBI::LegSecurityIDSource::Enum legSecurityIDSource() const
Marketplace assigned identifier.
UInt32 legSymbol() const
Product identifier of the leg security (only applicable for underlying leg).
EOBI::LegSecurityType::Enum legSecurityType() const
Leg Security Type.
EOBI::LegSide::Enum legSide() const
The side of the individual leg of a strategy as defined in signature.
EOBI::Implementation::InstrmtLegGrpSeqT AddComplexInstrumentEntryMsgData
UInt8 noLegs() const
Counter: number of Legs repeating group instances.