OpenMAMA C++ API
MamaQueue.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 MAMA_QUEUE_CPP_H__
23 #define MAMA_QUEUE_CPP_H__
24 
25 #include <mama/mamacpp.h>
26 #include <mama/queue.h>
27 
28 namespace Wombat
29 {
30 
31  class MamaQueueEnqueueCallback;
32  class MamaQueueMonitorCallback;
33  class MamaQueueEventCallback;
34 
40  class MAMACPPExpDLL MamaQueue
41  {
42 
43  public:
44  MamaQueue (void);
45  MamaQueue (mamaQueue cQueue);
46  virtual ~MamaQueue (void);
47 
57  virtual void create (
58  mamaBridge bridgeImpl);
59 
60  virtual void create (
61  mamaBridge bridgeImpl,
62  void* nativeQueue);
63 
68  virtual void dispatch ();
69 
73  virtual void timedDispatch (
74  uint64_t timeout);
75 
80  virtual void dispatchEvent ();
81 
82 
91  virtual void enqueueEvent (
92  MamaQueueEventCallback* callback,
93  void* closure);
94 
95  virtual void enqueueEvent (
96  MamaQueueEventCallback& callback,
97  void* closure);
98 
102  virtual void stopDispatch ();
103 
109  virtual size_t getEventCount ();
110 
119  virtual void setEnqueueCallback (
121  void* closure);
122 
131  virtual void setQueueMonitorCallback (
133  void* closure);
134 
156  virtual void setHighWatermark (
157  size_t highWatermark);
158 
162  virtual size_t getHighWatermark (void) const;
163 
169  virtual void setLowWatermark (
170  size_t lowWatermark);
171 
175  virtual size_t getLowWatermark (void) const;
176 
184  virtual void setQueueName (
185  const char* name);
186 
195  virtual const char* getQueueName () const;
196 
202  virtual const char* getQueueBridgeName () const;
203 
212  virtual void destroy ();
213 
214 
215  virtual void setClosure (
216  void* closure);
217 
218  virtual void* getClosure ();
219 
228  virtual void destroyTimedWait (
229  long timeout);
230 
237  virtual void destroyWait ();
238 
239 
243  mamaQueue getCValue ();
244  const mamaQueue getCValue () const;
245 
250  void setCValue (
251  mamaQueue cQueue);
252 
253  struct MamaQueueImpl;
254  MamaQueueImpl* mPimpl;
255  private:
256  mamaQueue mQueue;
257 
258  void destroyInternal (
259  mama_status status);
260  };
261 
262 } // namespace Wombat
263 #endif // MAMA_QUEUE_CPP_H__
MamaQueueImpl * mPimpl
Definition: MamaQueue.h:253
Definition: MamaConnection.h:29
Receive callbacks when certain conditions for the MamaQueue are met.
Definition: MamaQueueMonitorCallback.h:34
Callback interface for the MamaQueue::setEnqueueCallback () method.
Definition: MamaQueueEnqueueCallback.h:31
Queue allows applications to dispatch events in order with multiple threads using a single MamaDispat...
Definition: MamaQueue.h:40
Definition of the callback method for when a user added event fires.
Definition: MamaQueueEventCallback.h:36