OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.2.2
API documentation
AuctionBestBidOffer.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 
21 #include "MessageDataStructures.h"
22 #include "../Utils.h"
23 
24 
25 namespace OnixS{
26 namespace Eurex{
27 namespace MarketData{
28 namespace EOBI{
29 
31 
32 std::string AuctionBestBidOffer::msgType() const
33 {
34  return std::string("U23", 3);
35 }
36 
38 {
39  return EOBI::MarketDataType::AuctionBBO; // implied constant
40 }
41 
43 {
44  return EOBI::SecurityIDSource::Marketplace; // implied constant
45 }
46 
48 {
49  return (getData<AuctionBestBidOfferMsgData>())->TransactTime;
50 }
51 
53 {
54  return (getData<AuctionBestBidOfferMsgData>())->SecurityID;
55 }
56 
58 {
59  const AuctionBestBidOfferMsgData* msgData = getData<AuctionBestBidOfferMsgData>();
61  return false;
62 
63  price = Decimal(msgData->BidPx/100000000.0, 8u);
64  return true;
65 }
66 
68 {
69  const AuctionBestBidOfferMsgData* msgData = getData<AuctionBestBidOfferMsgData>();
71  return false;
72 
73  price = Decimal(msgData->OfferPx/100000000.0, 8u);
74  return true;
75 }
76 
78 {
79  const AuctionBestBidOfferMsgData* msgData = getData<AuctionBestBidOfferMsgData>();
81  return false;
82 
83  size = msgData->BidSize;
84  return true;
85 }
86 
88 {
89  const AuctionBestBidOfferMsgData* msgData = getData<AuctionBestBidOfferMsgData>();
91  return false;
92 
93  size = msgData->OfferSize;
94  return true;
95 }
96 
98 {
99  return static_cast<EOBI::PotentialSecurityTradingEvent::Enum>((getData<AuctionBestBidOfferMsgData>())->PotentialSecurityTradingEvent);
100 }
101 
103 {
104  return static_cast<EOBI::OrdType::Enum>((getData<AuctionBestBidOfferMsgData>())->BidOrdType);
105 }
106 
108 {
109  return static_cast<EOBI::OrdType::Enum>((getData<AuctionBestBidOfferMsgData>())->OfferOrdType);
110 }
111 
112 void AuctionBestBidOffer::toString(std::string& presentation) const
113 {
114  std::string buffer;
115 
116  try
117  {
118  buffer
119  << "AuctionBestBidOffer [msgSeqNum=" << msgSeqNum()
120  << ", TransactTime=" << transactTime()
121  << ", SecurityId=" << securityID();
122 
123  Decimal bid;
124  if(bidPx(bid))
125  buffer << ", bidPx=" << bid.toString();
126 
127  Decimal offer;
128  if(offerPx(offer))
129  buffer << ", offerPx=" << offer.toString();
130 
131  Int64 bSize;
132  if(bidSize(bSize))
133  presentation << ", bidSize=" << bSize;
134 
135  Int64 oSize;
136  if(offerSize(oSize))
137  presentation << ", offerSize=" << oSize;
138 
139  buffer << ']';
140  }
141  catch(...)
142  {
143  buffer.clear();
144 
145  const AuctionBestBidOfferMsgData* msgData = getData<AuctionBestBidOfferMsgData>();
146 
147  buffer
148  << "AuctionBestBidOffer [msgSeqNum=" << msgData->MessageHeader.MsgSeqNum
149  << ", TransactTime=" << msgData->TransactTime
150  << ", SecurityId=" << msgData->SecurityID
151  << ", bidPx=" << msgData->BidPx
152  << ", offerPx=" << msgData->OfferPx;
153 
154  buffer << ']';
155  }
156 
157  presentation << buffer;
158 }
159 
160 }}}}
bool offerSize(QuantityType &size) const
Used for cash market instruments only.
bool bidSize(QuantityType &size) const
Used for cash market instruments only.
PotentialSecurityTradingEvent::Enum potentialSecurityTradingEvent() const
Used for cash market instruments only.
std::string toString() const
Returns text presentation.
Definition: MessageBase.cpp:37
bool bidPx(Decimal &price) const
Bid price/rate.
EOBI::SecurityIDSource::Enum securityIDSource() const
Marketplace assigned identifier.
Definition: Defines.h:30
Decimal type for better precision.
Definition: Numeric.h:63
UInt32 msgSeqNum() const
Message sequence number.
Definition: MessageBase.cpp:32
UInt64 transactTime() const
Official timestamp of order book entry.
EOBI::MarketDataType::Enum marketDataType() const
Market data type.
bool offerPx(Decimal &price) const
Offer price/rate.
UInt64 securityID() const
Unique instrument identifier.
void toString(std::string &) const
Appends text presentation to given string.
Definition: Decimal.cpp:217
EOBI::Implementation::AuctionBestBidOfferMsgData AuctionBestBidOfferMsgData