OpenMAMA
MamdaOrderBookEntry.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamdaOrderBookEntryH
23 #define MamdaOrderBookEntryH
24 
29 #include <mama/MamaSource.h>
30 #include <mama/MamaSourceDerivative.h>
31 #include <mama/mamacpp.h>
32 
33 namespace Wombat
34 {
35 
36  class MamdaOrderBook;
37  class MamdaOrderBookPriceLevel;
38  class MamdaOrderBookEntryManager;
39 
48  class MAMDAOPTExpDLL MamdaOrderBookEntry
49  {
50  public:
57  enum Action
58  {
63  };
64 
66 
72 
77  MamdaOrderBookEntry (const char* entryId,
78  mama_quantity_t size,
79  Action action,
80  const MamaDateTime& entryTime,
81  const MamaSourceDerivative* deriv);
82 
84 
89  MamdaOrderBookEntry& operator= (const MamdaOrderBookEntry& rhs);
90 
91  void clear ();
92 
97  void copy (const MamdaOrderBookEntry& copy);
98 
99  void setId (const char* id);
100  void setUniqueId (const char* id);
101  void setSize (mama_quantity_t size);
102  void setAction (Action action);
103  void setReason (MamdaOrderBookTypes::Reason reason);
104  void setTime (const MamaDateTime& time);
105  void setStatus (mama_u16_t status);
106  void setDetails (const MamdaOrderBookEntry& copy);
107 
114  const char* getId () const;
115 
124  const char* getUniqueId () const;
125 
131  mama_quantity_t getSize () const;
132 
138  Action getAction () const;
139 
145  MamdaOrderBookTypes::Reason getReason () const;
146 
152  const MamaDateTime& getTime () const;
153 
159  mama_u16_t getStatus () const;
160 
169  double getPrice () const;
170  MamaPrice getMamaPrice () const;
179  MamdaOrderBookPriceLevel::Side getSide () const;
180 
198  mama_u32_t getPosition (mama_u32_t maxPos = 0) const;
199 
205  bool equalId (const char* id) const;
206 
215  bool operator== (const MamdaOrderBookEntry& rhs) const;
216 
225  bool operator!= (const MamdaOrderBookEntry& rhs) const
226  { return ! operator== (rhs); }
227 
235  void setPriceLevel (MamdaOrderBookPriceLevel* level);
236 
243  MamdaOrderBookPriceLevel* getPriceLevel () const;
244 
253  MamdaOrderBook* getOrderBook () const;
254 
262  void setManager(MamdaOrderBookEntryManager* manager);
263 
270  MamdaOrderBookEntryManager* getManager () const;
271 
280  const char* getSymbol () const;
281 
290  void setSourceDerivative (const MamaSourceDerivative* deriv);
291 
295  const MamaSourceDerivative* getSourceDerivative () const;
296 
300  const MamaSource* getSource () const;
301 
307  mamaSourceState getSourceState () const;
308 
314  bool getCheckSourceState () const;
315 
322  void setQuality (mamaQuality quality);
323 
330  mamaQuality getQuality () const;
331 
338  bool isVisible () const;
339 
345  void setClosure (void* closure);
346 
352  void* getClosure () const;
353 
364  void assertEqual (const MamdaOrderBookEntry& rhs) const;
365 
373  static void setStrictChecking (bool strict);
374 
375  private:
376  char* mId;
377  char* mUniqueId;
378  mama_quantity_t mSize;
379  MamaDateTime mTime;
380  MamdaOrderBookPriceLevel* mPriceLevel;
381  MamdaOrderBookEntryManager* mManager;
382  const MamaSourceDerivative* mSourceDeriv;
383  void* mClosure;
384  mamaQuality mQuality;
385  Action mAction;
386  mama_u16_t mStatus;
387 
389  };
390 
391 } // namespace
392 
393 #endif // MamdaOrderBookEntryH
A new price level.
Definition: MamdaOrderBookTypes.h:47
MamdaOrderBookEntry is a class that represents an entry within a price level of an order book...
Definition: MamdaOrderBookEntry.h:48
MamdaOrderImbalanceUpdate is an interface that provides access to order imbalance related fields...
Definition: MamdaAuctionFields.h:29
Side
An enumeration for the side order book side.
Definition: MamdaOrderBookPriceLevel.h:66
MamdaOrderBook is a class that provides order book functionality, including iterators over price leve...
Definition: MamdaOrderBook.h:47
A deleted price level.
Definition: MamdaOrderBookTypes.h:49
An updated price level.
Definition: MamdaOrderBookTypes.h:48
Definition: MamdaOrderBookTypes.h:46
Action
An enumeration for book entry actions.
Definition: MamdaOrderBookEntry.h:57
MamdaOrderBookEntryManager is a class that provides a global order book lookup service, matching entry IDs that are unique across a set of order books.
Definition: MamdaOrderBookEntryManager.h:42
Reason
An enumeration for a reason for a change.
Definition: MamdaOrderBookTypes.h:73
MamdaOrderBookPriceLevel is a class that provides a price level type for order books.
Definition: MamdaOrderBookPriceLevel.h:44


© 2012 Linux Foundation