summaryrefslogtreecommitdiffstats
path: root/veslibrary/ves_cpplibrary/src/lib/transport/gen-cpp/XRpcTransport.h
blob: 124702ecaf846dbe8c04d615b27545356fe5206a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
/**
 * Autogenerated by Thrift Compiler (0.12.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef XRpcTransport_H
#define XRpcTransport_H

#include <thrift/TDispatchProcessor.h>
#include <thrift/async/TConcurrentClientSyncInfo.h>
#include "rpc_types.h"

namespace vagt { namespace transport { namespace rpc {

#ifdef _MSC_VER
  #pragma warning( push )
  #pragma warning (disable : 4250 ) //inheriting methods via dominance 
#endif

class XRpcTransportIf {
 public:
  virtual ~XRpcTransportIf() {}
  virtual int16_t post(const std::string& data) = 0;
};

class XRpcTransportIfFactory {
 public:
  typedef XRpcTransportIf Handler;

  virtual ~XRpcTransportIfFactory() {}

  virtual XRpcTransportIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0;
  virtual void releaseHandler(XRpcTransportIf* /* handler */) = 0;
};

class XRpcTransportIfSingletonFactory : virtual public XRpcTransportIfFactory {
 public:
  XRpcTransportIfSingletonFactory(const ::apache::thrift::stdcxx::shared_ptr<XRpcTransportIf>& iface) : iface_(iface) {}
  virtual ~XRpcTransportIfSingletonFactory() {}

  virtual XRpcTransportIf* getHandler(const ::apache::thrift::TConnectionInfo&) {
    return iface_.get();
  }
  virtual void releaseHandler(XRpcTransportIf* /* handler */) {}

 protected:
  ::apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> iface_;
};

class XRpcTransportNull : virtual public XRpcTransportIf {
 public:
  virtual ~XRpcTransportNull() {}
  int16_t post(const std::string& /* data */) {
    int16_t _return = 0;
    return _return;
  }
};

typedef struct _XRpcTransport_post_args__isset {
  _XRpcTransport_post_args__isset() : data(false) {}
  bool data :1;
} _XRpcTransport_post_args__isset;

class XRpcTransport_post_args {
 public:

  XRpcTransport_post_args(const XRpcTransport_post_args&);
  XRpcTransport_post_args& operator=(const XRpcTransport_post_args&);
  XRpcTransport_post_args() : data() {
  }

  virtual ~XRpcTransport_post_args() throw();
  std::string data;

  _XRpcTransport_post_args__isset __isset;

  void __set_data(const std::string& val);

  bool operator == (const XRpcTransport_post_args & rhs) const
  {
    if (!(data == rhs.data))
      return false;
    return true;
  }
  bool operator != (const XRpcTransport_post_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const XRpcTransport_post_args & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};


class XRpcTransport_post_pargs {
 public:


  virtual ~XRpcTransport_post_pargs() throw();
  const std::string* data;

  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

typedef struct _XRpcTransport_post_result__isset {
  _XRpcTransport_post_result__isset() : success(false) {}
  bool success :1;
} _XRpcTransport_post_result__isset;

class XRpcTransport_post_result {
 public:

  XRpcTransport_post_result(const XRpcTransport_post_result&);
  XRpcTransport_post_result& operator=(const XRpcTransport_post_result&);
  XRpcTransport_post_result() : success(0) {
  }

  virtual ~XRpcTransport_post_result() throw();
  int16_t success;

  _XRpcTransport_post_result__isset __isset;

  void __set_success(const int16_t val);

  bool operator == (const XRpcTransport_post_result & rhs) const
  {
    if (!(success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const XRpcTransport_post_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const XRpcTransport_post_result & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

typedef struct _XRpcTransport_post_presult__isset {
  _XRpcTransport_post_presult__isset() : success(false) {}
  bool success :1;
} _XRpcTransport_post_presult__isset;

class XRpcTransport_post_presult {
 public:


  virtual ~XRpcTransport_post_presult() throw();
  int16_t* success;

  _XRpcTransport_post_presult__isset __isset;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);

};

class XRpcTransportClient : virtual public XRpcTransportIf {
 public:
  XRpcTransportClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  XRpcTransportClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  int16_t post(const std::string& data);
  void send_post(const std::string& data);
  int16_t recv_post();
 protected:
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
};

class XRpcTransportProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  ::apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> iface_;
  virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext);
 private:
  typedef  void (XRpcTransportProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_post(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
 public:
  XRpcTransportProcessor(::apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> iface) :
    iface_(iface) {
    processMap_["post"] = &XRpcTransportProcessor::process_post;
  }

  virtual ~XRpcTransportProcessor() {}
};

class XRpcTransportProcessorFactory : public ::apache::thrift::TProcessorFactory {
 public:
  XRpcTransportProcessorFactory(const ::apache::thrift::stdcxx::shared_ptr< XRpcTransportIfFactory >& handlerFactory) :
      handlerFactory_(handlerFactory) {}

  ::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo);

 protected:
  ::apache::thrift::stdcxx::shared_ptr< XRpcTransportIfFactory > handlerFactory_;
};

class XRpcTransportMultiface : virtual public XRpcTransportIf {
 public:
  XRpcTransportMultiface(std::vector<apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~XRpcTransportMultiface() {}
 protected:
  std::vector<apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> > ifaces_;
  XRpcTransportMultiface() {}
  void add(::apache::thrift::stdcxx::shared_ptr<XRpcTransportIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  int16_t post(const std::string& data) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->post(data);
    }
    return ifaces_[i]->post(data);
  }

};

// The 'concurrent' client is a thread safe client that correctly handles
// out of order responses.  It is slower than the regular client, so should
// only be used when you need to share a connection among multiple threads
class XRpcTransportConcurrentClient : virtual public XRpcTransportIf {
 public:
  XRpcTransportConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  XRpcTransportConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  int16_t post(const std::string& data);
  int32_t send_post(const std::string& data);
  int16_t recv_post(const int32_t seqid);
 protected:
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
  ::apache::thrift::async::TConcurrentClientSyncInfo sync_;
};

#ifdef _MSC_VER
  #pragma warning( pop )
#endif

}}} // namespace

#endif