OpenMAMA
MamdaOrderBookDepthFilter.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 MamdaOrderBookDepthFilterH
23 #define MamdaOrderBookDepthFilterH
24 
26 #include <mamda/MamdaMsgListener.h>
27 #include <mamda/MamdaOrderBook.h>
29 #include <mamda/MamdaFieldState.h>
30 
31 using namespace Wombat;
32 
33 class MamdaOrderBookDepthFilterImpl;
34 
36  , public MamdaOrderBookHandler
37 {
38 public:
39 
40  MamdaOrderBookDepthFilter (MamdaOrderBookListener& parent, size_t depth);
41 
42  virtual ~MamdaOrderBookDepthFilter ();
43 
51  virtual void addHandler (MamdaOrderBookHandler* handler);
56  virtual void removeHandlers ();
57 
61  virtual const MamdaOrderBook* getOrderBook () const;
62 
66  virtual const MamdaOrderBook* getFullOrderBook () const;
67 
68  virtual void onMsg (MamdaSubscription* subscription,
69  const MamaMsg& msg,
70  short msgType) { };
71 
72  virtual void onBookRecap (
73  MamdaSubscription* subscription,
74  MamdaOrderBookListener& listener,
75  const MamaMsg* msg,
76  const MamdaOrderBookComplexDelta* delta,
77  const MamdaOrderBookRecap& event,
78  const MamdaOrderBook& book);
79 
80 
81  virtual void onBookDelta (
82  MamdaSubscription* subscription,
83  MamdaOrderBookListener& listener,
84  const MamaMsg* msg,
85  const MamdaOrderBookSimpleDelta& event,
86  const MamdaOrderBook& book);
87 
88  virtual void onBookComplexDelta (
89  MamdaSubscription* subscription,
90  MamdaOrderBookListener& listener,
91  const MamaMsg* msg,
92  const MamdaOrderBookComplexDelta& event,
93  const MamdaOrderBook& book);
94 
95  virtual void onBookClear (
96  MamdaSubscription* subscription,
97  MamdaOrderBookListener& listener,
98  const MamaMsg* msg,
99  const MamdaOrderBookClear& event,
100  const MamdaOrderBook& book);
101 
102  virtual void onBookGap (
103  MamdaSubscription* subscription,
104  MamdaOrderBookListener& listener,
105  const MamaMsg* msg,
106  const MamdaOrderBookGap& event,
107  const MamdaOrderBook& book);
108 
109 private:
110  struct MamdaOrderBookListenerImpl;
111  MamdaOrderBookDepthFilterImpl& mImpl;
112 };
113 
114 #endif // MamdaOrderBookDepthFilterH
115 


© 2012 Linux Foundation