OpenMAMA
MamdaQuoteToBookListener.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 MamdaQuoteToBookListenerH
23 #define MamdaQuoteToBookListenerH
24 
26 #include <mamda/MamdaMsgListener.h>
27 #include <mamda/MamdaOrderBook.h>
29 #include <mamda/MamdaFieldState.h>
30 
31 using namespace Wombat;
32 
33 class MamdaQuoteToBookListenerImpl;
34 
36 {
37 public:
48  MamdaQuoteToBookListener (MamdaOrderBook* fullBook = NULL);
49 
50  virtual ~MamdaQuoteToBookListener ();
51 
59  virtual void addHandler (MamdaOrderBookHandler* handler);
60 
61  virtual void setProcessEntries (bool process);
62  virtual void addIgnoreEntryId (const char* id);
63  virtual void removeIgnoreEntryId (const char* id);
64  virtual void setUseEntryManager (bool useManager);
65  virtual void setEntryIdsAreUnique (bool uniqueIds);
66  virtual void setKeepBasicDeltas (bool keep);
67  virtual void setConflateDeltas (bool conflate);
68  virtual bool getConflateDeltas ();
69  virtual void setConflationInterval (double interval);
70  virtual void forceInvokeDeltaHandlers ();
71  virtual void clearConflatedDeltas ();
72  virtual void setProcessProperties (bool value);
73  virtual bool getProcessProperties () const;
74 
75  virtual MamdaFieldState getSymbolFieldState() const;
76  virtual MamdaFieldState getPartIdFieldState() const;
77  virtual MamdaFieldState getEventSeqNumFieldState() const;
78  virtual MamdaFieldState getEventTimeFieldState() const;
79  virtual MamdaFieldState getSrcTimeFieldState() const;
80  virtual MamdaFieldState getActivityTimeFieldState() const;
81  virtual MamdaFieldState getLineTimeFieldState() const;
82  virtual MamdaFieldState getSendTimeFieldState() const;
83  virtual MamdaFieldState getMsgQualFieldState() const;
84 
89  virtual void removeHandlers ();
90 
94  virtual void clear ();
95 
96  // Inherited from MamdaOrderBookGap
97  virtual mama_seqnum_t getBeginGapSeqNum () const;
98  virtual mama_seqnum_t getEndGapSeqNum () const;
99  // Inherited from MamdaOrderBookRecap
100  virtual const MamdaOrderBook* getOrderBook () const;
101  // Inherited from MamdaBasicRecap and MamdaBasicEvent
102  virtual const char* getSymbol () const;
103  virtual const char* getPartId () const;
104  virtual mama_seqnum_t getEventSeqNum () const;
105  virtual const MamaDateTime& getEventTime () const;
106  virtual const MamaDateTime& getSrcTime () const;
107  virtual const MamaDateTime& getActivityTime () const;
108  virtual const MamaDateTime& getLineTime () const;
109  virtual const MamaDateTime& getSendTime () const;
110  virtual const MamaMsgQual& getMsgQual () const;
111  // quote count specific to quote consumer
112  virtual mama_u32_t getQuoteCount () const;
113 
114  virtual void setUpdateInconsistentBook (bool update);
115  virtual void setUpdateStaleBook (bool update);
116  virtual void setClearStaleBook (bool clear);
117 
118  virtual void resolvePossiblyDuplicate (bool tf);
119 
123  virtual void setQuality (MamdaSubscription* sub,
124  mamaQuality quality);
125 
126  void setQuoteSizeMultiplier (int multiplier);
127 
131  virtual void onMsg (MamdaSubscription* subscription,
132  const MamaMsg& msg,
133  short msgType);
134 
135  virtual void acquireReadLock ();
136  virtual void releaseReadLock ();
137  virtual void acquireWriteLock ();
138  virtual void releaseWriteLock ();
139 
140  virtual void getBookSnapShot (MamdaOrderBook& result);
141 
142 private:
143  MamdaQuoteToBookListenerImpl& mImpl;
144 
145 };
146 
147 #endif // MamdaQuoteToBookListenerH
148 


© 2012 Linux Foundation