OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
OrderAdd.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 
22 #include "MessageDataStructures.h"
23 
24 #include "../Utils.h"
25 
26 namespace OnixS{
27 namespace Eurex{
28 namespace MarketData{
29 namespace EOBI{
30 
32 
33 std::string OrderAdd::msgType() const
34 {
35  return std::string("U21", 3); // implied constant
36 }
37 
39 {
40  return EOBI::MarketDataType::OrderBookMaintenance; // implied constant
41 }
42 
44 {
45  return EOBI::MDUpdateAction::New; // implied constant
46 }
47 
49 {
50  return EOBI::SecurityIDSource::Marketplace; // implied constant
51 }
52 
54 {
55  return (getData<OrderAddMsgData>())->TrdRegTSTimeIn;
56 }
57 
58 UInt64 OrderAdd::securityID() const
59 {
60  return (getData<OrderAddMsgData>())->SecurityID;
61 }
62 
64 {
65  return (getData<OrderAddMsgData>())->OrderDetails.TrdRegTSTimePriority;
66 }
67 
69 {
70  return (getData<OrderAddMsgData>())->OrderDetails.DisplayQty;
71 }
72 
74 {
75  return static_cast<EOBI::Side::Enum>((getData<OrderAddMsgData>())->OrderDetails.Side);
76 }
77 
79 {
80  return static_cast<EOBI::OrderType::Enum>((getData<OrderAddMsgData>())->OrderDetails.OrdType);
81 }
82 
83 bool OrderAdd::price (Decimal& value) const
84 {
85  const OrderAddMsgData* msgData = getData<OrderAddMsgData>();
87  return false;
88 
89  value = Decimal(msgData->OrderDetails.Price/100000000.0, 8u);
90  return true;
91 }
92 
93 void OrderAdd::toString(std::string& presentation) const
94 {
95  presentation
96  << "OrderAdd [msgSeqNum="
97  << msgSeqNum()
98  << ", securityID="
99  << securityID()
100  << ", side="
101  << Side::toString(side())
102  << ", trdRegTSTimeIn="
103  << trdRegTSTimeIn()
104  << ", trdRegTSTimePriority="
106  << ", displayQty="
107  << displayQty()
108  << ", OrdType=" << OrderType::toString(ordType());
109 
110  Decimal p;
111  if(price(p))
112  presentation << ", price=" << p.toString();
113 
114  presentation << ']';
115 }
116 
117 }}}}
std::string toString() const
Returns text presentation.
Definition: MessageBase.cpp:37
std::string msgType() const
Message type.
Definition: OrderAdd.cpp:33
EOBI::SecurityIDSource::Enum securityIDSource() const
Marketplace assigned identifier.
Definition: OrderAdd.cpp:48
UInt64 trdRegTSTimeIn() const
Matching engine In timestamp.
Definition: OrderAdd.cpp:53
EOBI::Implementation::OrderAddMsgData OrderAddMsgData
Definition: OrderAdd.cpp:31
Definition: Defines.h:30
Decimal type for better precision.
Definition: Numeric.h:63
UInt32 msgSeqNum() const
Message sequence number.
Definition: MessageBase.cpp:32
EOBI::MDUpdateAction::Enum mdUpdateAction() const
Type of Market Data update action.
Definition: OrderAdd.cpp:43
UInt64 securityID() const
Unique instrument identifier.
Definition: OrderAdd.cpp:58
UInt64 trdRegTSTimePriority() const
Priority timestamp.
Definition: OrderAdd.cpp:63
EOBI::Side::Enum side() const
Side of the order.
Definition: OrderAdd.cpp:73
void toString(std::string &) const
Appends text presentation to given string.
Definition: Decimal.cpp:217
static std::string toString(Enum value)
Definition: Defines.cpp:611
EOBI::OrderType::Enum ordType() const
Reserved for future release.
Definition: OrderAdd.cpp:78
EOBI::MarketDataType::Enum marketDataType() const
Market data type.
Definition: OrderAdd.cpp:38
static std::string toString(Enum value)
Definition: Defines.cpp:148
bool price(Decimal &price) const
Price.
Definition: OrderAdd.cpp:83
QuantityType displayQty() const
Quantity.
Definition: OrderAdd.cpp:68