OpenMAMA C++ API
MamaFt.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_FT_CPP_H_
23 #define MAMA_FT_CPP_H_
24 
25 #include <mama/ft.h>
26 #include <mama/MamaQueue.h>
27 
28 namespace Wombat
29 {
30  class MamaFtMember;
31 
32 
33  class MAMACPPExpDLL MamaFtMemberCallback
34  {
35  public:
37  {
38  };
39 
40  virtual void onFtStateChange (MamaFtMember* member,
41  const char* groupName,
42  mamaFtState state) = 0;
43  };
44 
45 
46  class MAMACPPExpDLL MamaFtMember
47  {
48  public:
49  MamaFtMember();
50  virtual ~MamaFtMember();
51 
52  virtual void setup (MamaQueue* queue,
53  MamaFtMemberCallback* handler,
54  MamaTransport* transport,
55  const char* groupName,
56  mama_u32_t weight,
57  mama_f64_t heartbeatInterval,
58  mama_f64_t timeoutInterval,
59  void* closure = NULL) = 0;
60 
61  void destroy ();
62  void activate ();
63  void deactivate ();
64  bool isActive () const;
65 
66  const char* getGroupName () const;
67  mama_u32_t getWeight () const;
68  mama_f64_t getHeartbeatInterval () const;
69  mama_f64_t getTimeoutInterval () const;
70  MamaFtMemberCallback* getCallback () const;
71  void* getClosure () const;
72 
73  void setWeight (mama_u32_t weight);
74  void setInstanceId (const char* id);
75 
76  mamaFtMember getCValue ()
77  {
78  return mCValue;
79  }
80  const mamaFtMember getCValue () const
81  {
82  return mCValue;
83  }
84 
85  protected:
86  mamaFtMember mCValue;
88  void* mClosure;
89  };
90 
91  class MAMACPPExpDLL MamaMulticastFtMember : public MamaFtMember
92  {
93  public:
94  void setup (MamaQueue* queue,
95  MamaFtMemberCallback* handler,
96  MamaTransport* transport,
97  const char* groupName,
98  mama_u32_t weight,
99  mama_f64_t heartbeatInterval,
100  mama_f64_t timeoutInterval,
101  void* closure = NULL);
102  };
103 
104  class MAMACPPExpDLL MamaBridgeFtMember : public MamaFtMember
105  {
106  public:
107  void setup (MamaQueue* queue,
108  MamaFtMemberCallback* handler,
109  MamaTransport* transport,
110  const char* groupName,
111  mama_u32_t weight,
112  mama_f64_t heartbeatInterval,
113  mama_f64_t timeoutInterval,
114  void* closure = NULL);
115  };
116 
117 } // namespace Wombat
118 
119 #endif // MAMA_FT_CPP_H_
Definition: MamaFt.h:33
Definition: MamaFt.h:104
const mamaFtMember getCValue() const
Definition: MamaFt.h:80
Definition: MamaConnection.h:29
virtual ~MamaFtMemberCallback()
Definition: MamaFt.h:36
MamaFtMemberCallback * mCallback
Definition: MamaFt.h:87
Definition: MamaFt.h:46
Definition: MamaFt.h:91
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
mamaFtMember mCValue
Definition: MamaFt.h:86
mamaFtMember getCValue()
Definition: MamaFt.h:76
void * mClosure
Definition: MamaFt.h:88