OpenMAMA
MamdaBookAtomicListener.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 MamdaBookAtomicListenerH
23 #define MamdaBookAtomicListenerH
24 
26 #include <mamda/MamdaMsgListener.h>
31 #include <mamda/MamdaFieldState.h>
33 
34 namespace Wombat
35 {
36 
37  class MamdaBookAtomicBookHandler;
38  class MamdaBookAtomicLevelHandler;
39  class MamdaBookAtomicLevelEntryHandler;
40 
68  class MAMDAOPTExpDLL MamdaBookAtomicListener :
69  public MamdaMsgListener
70  , public MamdaBookAtomicLevel
72  , public MamdaBookAtomicGap
73  {
74  public:
76  virtual ~MamdaBookAtomicListener ();
77 
78  void addBookHandler (MamdaBookAtomicBookHandler* handler);
79  void addLevelHandler (MamdaBookAtomicLevelHandler* handler);
80  void addLevelEntryHandler (MamdaBookAtomicLevelEntryHandler* handler);
81 
82  // Inherited from MamdaBasicRecap and MamdaBasicEvent
83  const char* getSymbol () const;
84  const char* getPartId () const;
85  const MamaDateTime& getSrcTime () const;
86  const MamaDateTime& getActivityTime () const;
87  const MamaDateTime& getLineTime () const;
88  const MamaDateTime& getSendTime () const;
89  const MamaMsgQual& getMsgQual () const;
90  const MamaDateTime& getEventTime () const;
91  mama_seqnum_t getEventSeqNum () const;
92 
93  MamdaFieldState getSymbolFieldState() const;
94  MamdaFieldState getPartIdFieldState() const;
95  MamdaFieldState getEventSeqNumFieldState() const;
96  MamdaFieldState getEventTimeFieldState() const;
97  MamdaFieldState getSrcTimeFieldState() const;
98  MamdaFieldState getActivityTimeFieldState() const;
99  MamdaFieldState getLineTimeFieldState() const;
100  MamdaFieldState getSendTimeFieldState() const;
101  MamdaFieldState getMsgQualFieldState() const;
102 
103  // Inherited from MamdaBookAtomicLevel and MamdaBookAtomicLevelEntry
104  mama_u32_t getPriceLevelNumLevels () const;
105  mama_u32_t getPriceLevelNum () const;
106  double getPriceLevelPrice () const;
107  MamaPrice& getPriceLevelMamaPrice () const;
108  mama_f64_t getPriceLevelSize () const;
109  mama_i64_t getPriceLevelSizeChange () const;
110  char getPriceLevelAction () const;
111  char getPriceLevelSide () const;
112  const MamaDateTime& getPriceLevelTime () const;
113  mama_f32_t getPriceLevelNumEntries () const;
114  mama_u32_t getPriceLevelActNumEntries () const;
115  char getPriceLevelEntryAction () const;
116  char getPriceLevelEntryReason () const;
117  const char* getPriceLevelEntryId () const;
118  mama_u64_t getPriceLevelEntrySize () const;
119  const MamaDateTime& getPriceLevelEntryTime () const;
120 
121  MamdaOrderBookTypes::OrderType getOrderType () const;
122  void setOrderType (MamdaOrderBookTypes::OrderType orderType) const;
123 
124  bool getHasMarketOrders () const;
125  void setProcessMarketOrders (bool process) const;
126 
127 
128  // Inherited from MamdaOrderBookGap
129  mama_seqnum_t getBeginGapSeqNum () const;
130  mama_seqnum_t getEndGapSeqNum () const;
131 
132  // Implementation of MamdaListener interface.
133  virtual void onMsg (MamdaSubscription* subscription,
134  const MamaMsg& msg,
135  short msgType);
136 
137  private:
138  struct MamdaBookAtomicListenerImpl;
139  MamdaBookAtomicListenerImpl& mImpl;
140  };
141 
142 } // namespace
143 
144 #endif // MamdaBookAtomicListenerH
145 
MamdaBookAtomicLevel is an interface that provides access to trade related fields.
Definition: MamdaBookAtomicLevel.h:36
OrderType
An enumeration for the type of level.
Definition: MamdaOrderBookTypes.h:98
MamdaBookAtomicListener is a class that specializes in handling order book updates.
Definition: MamdaBookAtomicListener.h:68
MamdaOrderImbalanceUpdate is an interface that provides access to order imbalance related fields...
Definition: MamdaAuctionFields.h:29
MamdaBookAtomicBookHandler is an interface for applications that need to know when a MamdaBookAtomicL...
Definition: MamdaBookAtomicBookHandler.h:45
MamdaBookAtomicLevelEntryHandler is an interface for applications that want to have an easy way to ha...
Definition: MamdaBookAtomicLevelEntryHandler.h:41
MamdaBookAtomicLevelHandler is an interface for applications that want to have an easy way to handle ...
Definition: MamdaBookAtomicLevelHandler.h:42
MamdaBookAtomicLevel is an interface that provides access to Price Level and Price Level Entry fields...
Definition: MamdaBookAtomicLevelEntry.h:35
MamdaBookAtomicGap is an interface that provides access to order book atomic update gap related field...
Definition: MamdaBookAtomicGap.h:35
A MamdaSubscription is used to register interest in a particular symbol and source.
Definition: MamdaSubscription.h:54
MamdaFieldState
An enumeration representing field state.
Definition: MamdaFieldState.h:37
MamdaMsgListener defines an interface for handling MAMA messages for a MamdaSubscription.
Definition: MamdaMsgListener.h:38


© 2012 Linux Foundation