OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.0.3
API documentation
OrderBookSnapshot.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 
20 #include "OrderBookSnapshot.h"
21 
22 using namespace OnixS::Eurex::MarketData;
23 
25 : OrderBook(other.securityId(), other.depth())
26 , asks_(other.asks().begin(), other.asks().end())
27 , bids_(other.bids().begin(), other.bids().end())
28 , entryTime_(other.mdEntryTime())
29 , lastMsgSeqNumProcessed_(other.lastMsgSeqNumProcessed())
30 {
31  bestBidAvailable_ = other.bestBid(bestBidPrice_, bestBidQuantity_);
32  bestAskAvailable_ = other.bestAsk(bestAskPrice_, bestAskQuantity_);
33 }
34 
36 {
37  return asks_;
38 }
39 
41 {
42  return bids_;
43 }
44 
45 bool OrderBookSnapshot::bestAsk(Decimal& price, Quantity& quantity) const
46 {
47  if(bestAskAvailable_)
48  {
49  price = bestAskPrice_;
50  quantity = bestAskQuantity_;
51  return true;
52  }
53  return false;
54 }
55 
56 bool OrderBookSnapshot::bestBid(Decimal& price, Quantity& quantity) const
57 {
58  if(bestBidAvailable_)
59  {
60  price = bestBidPrice_;
61  quantity = bestBidQuantity_;
62  return true;
63  }
64  return false;
65 }
66 
68 {
69  return entryTime_;
70 }
71 
73 {
74  return lastMsgSeqNumProcessed_;
75 }
UInt64 mdEntryTime() const
For bids and offers the official time of book entry, for trades official time of execution (all in na...
virtual bool bestBid(Decimal &price, Quantity &quantity) const =0
Returns best implied bid.
bool bestAsk(Decimal &price, Quantity &quantity) const
Returns best implied ask.
unsigned int UInt32
Definition: Numeric.h:41
Decimal type for better precision.
Definition: Numeric.h:63
PriceLevelCollections::Array PriceLevels
Sequence of price levels.
Definition: OrderBook.h:135
bool bestBid(Decimal &price, Quantity &quantity) const
Returns best implied bid.
const PriceLevels & bids() const
Returns a set of ascending ask prices for the given security.
const PriceLevels & asks() const
Returns a set of descending bid prices for the given security.
UInt64 Quantity
Alias for Quantity type.
Definition: Defines.h:54
virtual bool bestAsk(Decimal &price, Quantity &quantity) const =0
Returns best implied ask.
UInt32 lastMsgSeqNumProcessed() const
Sequence number of the last processed message.