Ice 3.7 C++11 API Reference
Loading...
Searching...
No Matches
CommunicatorAsync.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#ifndef ICE_COMMUNICATOR_ASYNC_H
6#define ICE_COMMUNICATOR_ASYNC_H
7
8#ifndef ICE_CPP11_MAPPING
9
10#include <Ice/Communicator.h>
11
12namespace Ice
13{
14
21template<class T>
22class CallbackNC_Communicator_flushBatchRequests : public Callback_Communicator_flushBatchRequests_Base,
23 public ::IceInternal::OnewayCallbackNC<T>
24{
25public:
26
27 typedef IceUtil::Handle<T> TPtr;
28
29 typedef void (T::*Exception)(const ::Ice::Exception&);
30 typedef void (T::*Sent)(bool);
31
32 CallbackNC_Communicator_flushBatchRequests(const TPtr& obj, Exception excb, Sent sentcb)
33 : ::IceInternal::OnewayCallbackNC<T>(obj, 0, excb, sentcb)
34 {
35 }
36
38 virtual void completed(const ::Ice::AsyncResultPtr& result) const
39 {
40 ::Ice::CommunicatorPtr communicator = result->getCommunicator();
41 assert(communicator);
42 try
43 {
44 communicator->end_flushBatchRequests(result);
45 assert(false);
46 }
47 catch(const ::Ice::Exception& ex)
48 {
49 ::IceInternal::CallbackNC<T>::exception(result, ex);
50 }
51 }
53};
54
63template<class T> Callback_Communicator_flushBatchRequestsPtr
64newCallback_Communicator_flushBatchRequests(const IceUtil::Handle<T>& instance,
65 void (T::*excb)(const ::Ice::Exception&),
66 void (T::*sentcb)(bool) = 0)
67{
68 return new CallbackNC_Communicator_flushBatchRequests<T>(instance, excb, sentcb);
69}
70
79template<class T> Callback_Communicator_flushBatchRequestsPtr
80newCallback_Communicator_flushBatchRequests(T* instance, void (T::*excb)(const ::Ice::Exception&),
81 void (T::*sentcb)(bool) = 0)
82{
83 return new CallbackNC_Communicator_flushBatchRequests<T>(instance, excb, sentcb);
84}
85
92template<class T, typename CT>
93class Callback_Communicator_flushBatchRequests : public Callback_Communicator_flushBatchRequests_Base,
94 public ::IceInternal::OnewayCallback<T, CT>
95{
96public:
97
98 typedef IceUtil::Handle<T> TPtr;
99
100 typedef void (T::*Exception)(const ::Ice::Exception& , const CT&);
101 typedef void (T::*Sent)(bool , const CT&);
102
103 Callback_Communicator_flushBatchRequests(const TPtr& obj, Exception excb, Sent sentcb)
104 : ::IceInternal::OnewayCallback<T, CT>(obj, 0, excb, sentcb)
105 {
106 }
107
109 virtual void completed(const ::Ice::AsyncResultPtr& result) const
110 {
111 ::Ice::CommunicatorPtr communicator = result->getCommunicator();
112 assert(communicator);
113 try
114 {
115 communicator->end_flushBatchRequests(result);
116 assert(false);
117 }
118 catch(const ::Ice::Exception& ex)
119 {
120 ::IceInternal::Callback<T, CT>::exception(result, ex);
121 }
122 }
124};
125
131template<class T, typename CT> Callback_Communicator_flushBatchRequestsPtr
132newCallback_Communicator_flushBatchRequests(const IceUtil::Handle<T>& instance,
133 void (T::*excb)(const ::Ice::Exception&, const CT&),
134 void (T::*sentcb)(bool, const CT&) = 0)
135{
136 return new Callback_Communicator_flushBatchRequests<T, CT>(instance, excb, sentcb);
137}
138
144template<class T, typename CT> Callback_Communicator_flushBatchRequestsPtr
145newCallback_Communicator_flushBatchRequests(T* instance, void (T::*excb)(const ::Ice::Exception&, const CT&),
146 void (T::*sentcb)(bool, const CT&) = 0)
147{
148 return new Callback_Communicator_flushBatchRequests<T, CT>(instance, excb, sentcb);
149}
150
151}
152#endif
153
154#endif
Definition BuiltinSequences.h:56