Ice 3.7 C++11 API Reference
ConnectionAsync.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #ifndef ICE_CONNECTION_ASYNC_H
6 #define ICE_CONNECTION_ASYNC_H
7 
8 #ifndef ICE_CPP11_MAPPING
9 
10 #include <Ice/Connection.h>
11 #include <Ice/Proxy.h>
12 
13 namespace Ice
14 {
15 
22 template<class T>
23 class CallbackNC_Connection_flushBatchRequests : public Callback_Connection_flushBatchRequests_Base,
24  public ::IceInternal::OnewayCallbackNC<T>
25 {
26 public:
27 
28  typedef IceUtil::Handle<T> TPtr;
29 
30  typedef void (T::*Exception)(const ::Ice::Exception&);
31  typedef void (T::*Sent)(bool);
32 
33  CallbackNC_Connection_flushBatchRequests(const TPtr& obj, Exception excb, Sent sentcb)
34  : ::IceInternal::OnewayCallbackNC<T>(obj, 0, excb, sentcb)
35  {
36  }
37 
39  virtual void completed(const ::Ice::AsyncResultPtr& result) const
40  {
41  ::Ice::ConnectionPtr connection = result->getConnection();
42  assert(connection);
43  try
44  {
45  connection->end_flushBatchRequests(result);
46  assert(false);
47  }
48  catch(const ::Ice::Exception& ex)
49  {
50  ::IceInternal::CallbackNC<T>::exception(result, ex);
51  }
52  }
54 };
55 
64 template<class T> Callback_Connection_flushBatchRequestsPtr
65 newCallback_Connection_flushBatchRequests(const IceUtil::Handle<T>& instance,
66  void (T::*excb)(const ::Ice::Exception&),
67  void (T::*sentcb)(bool) = 0)
68 {
69  return new CallbackNC_Connection_flushBatchRequests<T>(instance, excb, sentcb);
70 }
71 
80 template<class T> Callback_Connection_flushBatchRequestsPtr
81 newCallback_Connection_flushBatchRequests(T* instance, void (T::*excb)(const ::Ice::Exception&),
82  void (T::*sentcb)(bool) = 0)
83 {
84  return new CallbackNC_Connection_flushBatchRequests<T>(instance, excb, sentcb);
85 }
86 
93 template<class T, typename CT>
94 class Callback_Connection_flushBatchRequests : public Callback_Connection_flushBatchRequests_Base,
95  public ::IceInternal::OnewayCallback<T, CT>
96 {
97 public:
98 
99  typedef IceUtil::Handle<T> TPtr;
100 
101  typedef void (T::*Exception)(const ::Ice::Exception& , const CT&);
102  typedef void (T::*Sent)(bool , const CT&);
103 
104  Callback_Connection_flushBatchRequests(const TPtr& obj, Exception excb, Sent sentcb)
105  : ::IceInternal::OnewayCallback<T, CT>(obj, 0, excb, sentcb)
106  {
107  }
108 
110  virtual void completed(const ::Ice::AsyncResultPtr& result) const
111  {
112  ::Ice::ConnectionPtr connection = result->getConnection();
113  assert(connection);
114  try
115  {
116  connection->end_flushBatchRequests(result);
117  assert(false);
118  }
119  catch(const ::Ice::Exception& ex)
120  {
121  ::IceInternal::Callback<T, CT>::exception(result, ex);
122  }
123  }
125 };
126 
135 template<class T, typename CT> Callback_Connection_flushBatchRequestsPtr
136 newCallback_Connection_flushBatchRequests(const IceUtil::Handle<T>& instance,
137  void (T::*excb)(const ::Ice::Exception&, const CT&),
138  void (T::*sentcb)(bool, const CT&) = 0)
139 {
140  return new Callback_Connection_flushBatchRequests<T, CT>(instance, excb, sentcb);
141 }
142 
151 template<class T, typename CT> Callback_Connection_flushBatchRequestsPtr
152 newCallback_Connection_flushBatchRequests(T* instance, void (T::*excb)(const ::Ice::Exception&, const CT&),
153  void (T::*sentcb)(bool, const CT&) = 0)
154 {
155  return new Callback_Connection_flushBatchRequests<T, CT>(instance, excb, sentcb);
156 }
157 
164 template<class T>
165 class CallbackNC_Connection_heartbeat : public Callback_Connection_heartbeat_Base,
166  public ::IceInternal::OnewayCallbackNC<T>
167 {
168 public:
169 
170  typedef IceUtil::Handle<T> TPtr;
171 
172  typedef void (T::*Exception)(const ::Ice::Exception&);
173  typedef void (T::*Sent)(bool);
174 
175  CallbackNC_Connection_heartbeat(const TPtr& obj, Exception excb, Sent sentcb)
176  : ::IceInternal::OnewayCallbackNC<T>(obj, 0, excb, sentcb)
177  {
178  }
179 
181  virtual void completed(const ::Ice::AsyncResultPtr& __result) const
182  {
183  ::Ice::ConnectionPtr __con = __result->getConnection();
184  assert(__con);
185  try
186  {
187  __con->end_heartbeat(__result);
188  assert(false);
189  }
190  catch(const ::Ice::Exception& ex)
191  {
192  ::IceInternal::CallbackNC<T>::exception(__result, ex);
193  }
194  }
196 };
197 
206 template<class T> Callback_Connection_heartbeatPtr
207 newCallback_Connection_heartbeat(const IceUtil::Handle<T>& instance,
208  void (T::*excb)(const ::Ice::Exception&),
209  void (T::*sentcb)(bool) = 0)
210 {
211  return new CallbackNC_Connection_heartbeat<T>(instance, excb, sentcb);
212 }
213 
222 template<class T> Callback_Connection_heartbeatPtr
223 newCallback_Connection_heartbeat(T* instance, void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0)
224 {
225  return new CallbackNC_Connection_heartbeat<T>(instance, excb, sentcb);
226 }
227 
234 template<class T, typename CT>
235 class Callback_Connection_heartbeat : public Callback_Connection_heartbeat_Base,
236  public ::IceInternal::OnewayCallback<T, CT>
237 {
238 public:
239 
240  typedef IceUtil::Handle<T> TPtr;
241 
242  typedef void (T::*Exception)(const ::Ice::Exception& , const CT&);
243  typedef void (T::*Sent)(bool , const CT&);
244 
245  Callback_Connection_heartbeat(const TPtr& obj, Exception excb, Sent sentcb)
246  : ::IceInternal::OnewayCallback<T, CT>(obj, 0, excb, sentcb)
247  {
248  }
249 
251  virtual void completed(const ::Ice::AsyncResultPtr& __result) const
252  {
253  ::Ice::ConnectionPtr __con = __result->getConnection();
254  assert(__con);
255  try
256  {
257  __con->end_heartbeat(__result);
258  assert(false);
259  }
260  catch(const ::Ice::Exception& ex)
261  {
262  ::IceInternal::Callback<T, CT>::exception(__result, ex);
263  }
264  }
266 };
267 
276 template<class T, typename CT> Callback_Connection_heartbeatPtr
277 newCallback_Connection_heartbeat(const IceUtil::Handle<T>& instance,
278  void (T::*excb)(const ::Ice::Exception&, const CT&),
279  void (T::*sentcb)(bool, const CT&) = 0)
280 {
281  return new Callback_Connection_heartbeat<T, CT>(instance, excb, sentcb);
282 }
283 
292 template<class T, typename CT> Callback_Connection_heartbeatPtr
293 newCallback_Connection_heartbeat(T* instance, void (T::*excb)(const ::Ice::Exception&, const CT&),
294  void (T::*sentcb)(bool, const CT&) = 0)
295 {
296  return new Callback_Connection_heartbeat<T, CT>(instance, excb, sentcb);
297 }
298 
299 }
300 
301 #endif
302 #endif
Ice::Exception
IceUtil::Exception Exception
Definition: Exception.h:20
Connection.h
Proxy.h
Ice
Definition: BuiltinSequences.h:56
IceUtil::Handle
Definition: Handle.h:143