OpenMAMA C++ API
MamaPublisher.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_PUBLISHER_CPP_H__
23 #define MAMA_PUBLISHER_CPP_H__
24 
25 #include "mama/mamacpp.h"
27 
28 namespace Wombat
29 {
30  class MamaInbox;
31  class MamaPublisherImpl;
32  class MamaSendCompleteCallback;
33  class MamaPublisherCallback;
34 
41  class MAMACPPExpDLL MamaPublisher
42  {
43  public:
44  virtual ~MamaPublisher (void);
45 
46  MamaPublisher (void);
47 
59  virtual void create (
60  MamaTransport* transport,
61  const char* topic,
62  const char* source = NULL,
63  const char* root = NULL);
64 
65  virtual void createWithCallbacks (
66  MamaTransport* transport,
67  MamaQueue* queue,
69  void* closure,
70  const char* topic,
71  const char* source = NULL,
72  const char* root = NULL);
73 
74  virtual void send (
75  MamaMsg* msg) const;
76 
77  virtual void sendWithThrottle (
78  MamaMsg* msg,
80  void* closure) const ;
81 
82  virtual void sendFromInbox (
83  MamaInbox* inbox,
84  MamaMsg* msg) const;
85 
86  virtual void sendFromInboxWithThrottle(
87  MamaInbox* inbox,
88  MamaMsg* msg,
90  void* closure) const;
91 
92  virtual void sendReplyToInbox (
93  const MamaMsg& request,
94  MamaMsg* reply) const;
95 
96  virtual void sendReplyToInbox (
97  mamaMsgReply replyHandle,
98  MamaMsg* reply) const;
99 
100  virtual void destroy (void);
101 
102  virtual void destroyEx (void);
103 
107  virtual MamaTransport* getTransport (void) const;
108 
109  virtual mamaPublisherState getState() const;
110 
111  virtual const char* stringForState(mamaPublisherState state) const;
112 
113  virtual const char* getRoot () const;
114 
115  virtual const char* getSource () const;
116 
117  virtual const char* getSymbol () const;
118 
119  virtual MamaPublisherCallback* getCallback() const;
120 
121  protected:
123 
124  private:
125  MamaPublisher (MamaPublisherImpl* impl);
126  MamaPublisherImpl* mPimpl;
127  MamaPublisherCallback* mCallback;
128  bool destroyed;
129  };
130 
131 } // namespace Wombat
132 #endif // MAMA_PUBLISHER_CPP_H__
Definition: MamaPublisherCallback.h:29
Callback interface for use with the MamaPublisher.sendWithThrottle() and MamaPublisher.sendFromInboxWithThrottle() methods.
Definition: MamaSendCompleteCallback.h:42
MAMA message representation.
Definition: MamaMsg.h:112
Definition: MamaConnection.h:29
Used for sending messages requesting a direct reply.
Definition: MamaInbox.h:33
Queue allows applications to dispatch events in order with multiple threads using a single MamaDispat...
Definition: MamaQueue.h:40
The MamaTransport class provides market data functionality.
Definition: MamaTransport.h:261
MamaTransport * mTransport
Definition: MamaPublisher.h:122
The publisher class publishes messages to basic or market data subscriptions depending on the underly...
Definition: MamaPublisher.h:41