1 /**
2  * Autogenerated by Thrift Compiler (0.9.1)
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated
6  */
7 #ifndef QueryTeleService_H
8 #define QueryTeleService_H
9 
10 #include <thrift/TDispatchProcessor.h>
11 #include "querytele_types.h"
12 
13 namespace querytele
14 {
15 
16 class QueryTeleServiceIf
17 {
18 public:
~QueryTeleServiceIf()19     virtual ~QueryTeleServiceIf() {}
20     virtual void postQuery(const QueryTele& query) = 0;
21     virtual void postStep(const StepTele& query) = 0;
22     virtual void postImport(const ImportTele& query) = 0;
23 };
24 
25 class QueryTeleServiceIfFactory
26 {
27 public:
28     typedef QueryTeleServiceIf Handler;
29 
~QueryTeleServiceIfFactory()30     virtual ~QueryTeleServiceIfFactory() {}
31 
32     virtual QueryTeleServiceIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0;
33     virtual void releaseHandler(QueryTeleServiceIf* /* handler */) = 0;
34 };
35 
36 class QueryTeleServiceIfSingletonFactory : virtual public QueryTeleServiceIfFactory
37 {
38 public:
QueryTeleServiceIfSingletonFactory(const boost::shared_ptr<QueryTeleServiceIf> & iface)39     QueryTeleServiceIfSingletonFactory(const boost::shared_ptr<QueryTeleServiceIf>& iface) : iface_(iface) {}
~QueryTeleServiceIfSingletonFactory()40     virtual ~QueryTeleServiceIfSingletonFactory() {}
41 
getHandler(const::apache::thrift::TConnectionInfo &)42     virtual QueryTeleServiceIf* getHandler(const ::apache::thrift::TConnectionInfo&)
43     {
44         return iface_.get();
45     }
releaseHandler(QueryTeleServiceIf *)46     virtual void releaseHandler(QueryTeleServiceIf* /* handler */) {}
47 
48 protected:
49     boost::shared_ptr<QueryTeleServiceIf> iface_;
50 };
51 
52 class QueryTeleServiceNull : virtual public QueryTeleServiceIf
53 {
54 public:
~QueryTeleServiceNull()55     virtual ~QueryTeleServiceNull() {}
postQuery(const QueryTele &)56     void postQuery(const QueryTele& /* query */)
57     {
58         return;
59     }
postStep(const StepTele &)60     void postStep(const StepTele& /* query */)
61     {
62         return;
63     }
postImport(const ImportTele &)64     void postImport(const ImportTele& /* query */)
65     {
66         return;
67     }
68 };
69 
70 typedef struct _QueryTeleService_postQuery_args__isset
71 {
_QueryTeleService_postQuery_args__isset_QueryTeleService_postQuery_args__isset72     _QueryTeleService_postQuery_args__isset() : query(false) {}
73     bool query;
74 } _QueryTeleService_postQuery_args__isset;
75 
76 class QueryTeleService_postQuery_args
77 {
78 public:
79 
QueryTeleService_postQuery_args()80     QueryTeleService_postQuery_args()
81     {
82     }
83 
~QueryTeleService_postQuery_args()84     virtual ~QueryTeleService_postQuery_args() throw() {}
85 
86     QueryTele query;
87 
88     _QueryTeleService_postQuery_args__isset __isset;
89 
__set_query(const QueryTele & val)90     void __set_query(const QueryTele& val)
91     {
92         query = val;
93     }
94 
95     bool operator == (const QueryTeleService_postQuery_args& rhs) const
96     {
97         if (!(query == rhs.query))
98             return false;
99 
100         return true;
101     }
102     bool operator != (const QueryTeleService_postQuery_args& rhs) const
103     {
104         return !(*this == rhs);
105     }
106 
107     bool operator < (const QueryTeleService_postQuery_args& ) const;
108 
109     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
110     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
111 
112 };
113 
114 
115 class QueryTeleService_postQuery_pargs
116 {
117 public:
118 
119 
~QueryTeleService_postQuery_pargs()120     virtual ~QueryTeleService_postQuery_pargs() throw() {}
121 
122     const QueryTele* query;
123 
124     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
125 
126 };
127 
128 
129 class QueryTeleService_postQuery_result
130 {
131 public:
132 
QueryTeleService_postQuery_result()133     QueryTeleService_postQuery_result()
134     {
135     }
136 
~QueryTeleService_postQuery_result()137     virtual ~QueryTeleService_postQuery_result() throw() {}
138 
139 
140     bool operator == (const QueryTeleService_postQuery_result& /* rhs */) const
141     {
142         return true;
143     }
144     bool operator != (const QueryTeleService_postQuery_result& rhs) const
145     {
146         return !(*this == rhs);
147     }
148 
149     bool operator < (const QueryTeleService_postQuery_result& ) const;
150 
151     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
152     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
153 
154 };
155 
156 
157 class QueryTeleService_postQuery_presult
158 {
159 public:
160 
161 
~QueryTeleService_postQuery_presult()162     virtual ~QueryTeleService_postQuery_presult() throw() {}
163 
164 
165     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
166 
167 };
168 
169 typedef struct _QueryTeleService_postStep_args__isset
170 {
_QueryTeleService_postStep_args__isset_QueryTeleService_postStep_args__isset171     _QueryTeleService_postStep_args__isset() : query(false) {}
172     bool query;
173 } _QueryTeleService_postStep_args__isset;
174 
175 class QueryTeleService_postStep_args
176 {
177 public:
178 
QueryTeleService_postStep_args()179     QueryTeleService_postStep_args()
180     {
181     }
182 
~QueryTeleService_postStep_args()183     virtual ~QueryTeleService_postStep_args() throw() {}
184 
185     StepTele query;
186 
187     _QueryTeleService_postStep_args__isset __isset;
188 
__set_query(const StepTele & val)189     void __set_query(const StepTele& val)
190     {
191         query = val;
192     }
193 
194     bool operator == (const QueryTeleService_postStep_args& rhs) const
195     {
196         if (!(query == rhs.query))
197             return false;
198 
199         return true;
200     }
201     bool operator != (const QueryTeleService_postStep_args& rhs) const
202     {
203         return !(*this == rhs);
204     }
205 
206     bool operator < (const QueryTeleService_postStep_args& ) const;
207 
208     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
209     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
210 
211 };
212 
213 
214 class QueryTeleService_postStep_pargs
215 {
216 public:
217 
218 
~QueryTeleService_postStep_pargs()219     virtual ~QueryTeleService_postStep_pargs() throw() {}
220 
221     const StepTele* query;
222 
223     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
224 
225 };
226 
227 
228 class QueryTeleService_postStep_result
229 {
230 public:
231 
QueryTeleService_postStep_result()232     QueryTeleService_postStep_result()
233     {
234     }
235 
~QueryTeleService_postStep_result()236     virtual ~QueryTeleService_postStep_result() throw() {}
237 
238 
239     bool operator == (const QueryTeleService_postStep_result& /* rhs */) const
240     {
241         return true;
242     }
243     bool operator != (const QueryTeleService_postStep_result& rhs) const
244     {
245         return !(*this == rhs);
246     }
247 
248     bool operator < (const QueryTeleService_postStep_result& ) const;
249 
250     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
251     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
252 
253 };
254 
255 
256 class QueryTeleService_postStep_presult
257 {
258 public:
259 
260 
~QueryTeleService_postStep_presult()261     virtual ~QueryTeleService_postStep_presult() throw() {}
262 
263 
264     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
265 
266 };
267 
268 typedef struct _QueryTeleService_postImport_args__isset
269 {
_QueryTeleService_postImport_args__isset_QueryTeleService_postImport_args__isset270     _QueryTeleService_postImport_args__isset() : query(false) {}
271     bool query;
272 } _QueryTeleService_postImport_args__isset;
273 
274 class QueryTeleService_postImport_args
275 {
276 public:
277 
QueryTeleService_postImport_args()278     QueryTeleService_postImport_args()
279     {
280     }
281 
~QueryTeleService_postImport_args()282     virtual ~QueryTeleService_postImport_args() throw() {}
283 
284     ImportTele query;
285 
286     _QueryTeleService_postImport_args__isset __isset;
287 
__set_query(const ImportTele & val)288     void __set_query(const ImportTele& val)
289     {
290         query = val;
291     }
292 
293     bool operator == (const QueryTeleService_postImport_args& rhs) const
294     {
295         if (!(query == rhs.query))
296             return false;
297 
298         return true;
299     }
300     bool operator != (const QueryTeleService_postImport_args& rhs) const
301     {
302         return !(*this == rhs);
303     }
304 
305     bool operator < (const QueryTeleService_postImport_args& ) const;
306 
307     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
308     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
309 
310 };
311 
312 
313 class QueryTeleService_postImport_pargs
314 {
315 public:
316 
317 
~QueryTeleService_postImport_pargs()318     virtual ~QueryTeleService_postImport_pargs() throw() {}
319 
320     const ImportTele* query;
321 
322     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
323 
324 };
325 
326 
327 class QueryTeleService_postImport_result
328 {
329 public:
330 
QueryTeleService_postImport_result()331     QueryTeleService_postImport_result()
332     {
333     }
334 
~QueryTeleService_postImport_result()335     virtual ~QueryTeleService_postImport_result() throw() {}
336 
337 
338     bool operator == (const QueryTeleService_postImport_result& /* rhs */) const
339     {
340         return true;
341     }
342     bool operator != (const QueryTeleService_postImport_result& rhs) const
343     {
344         return !(*this == rhs);
345     }
346 
347     bool operator < (const QueryTeleService_postImport_result& ) const;
348 
349     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
350     uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
351 
352 };
353 
354 
355 class QueryTeleService_postImport_presult
356 {
357 public:
358 
359 
~QueryTeleService_postImport_presult()360     virtual ~QueryTeleService_postImport_presult() throw() {}
361 
362 
363     uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
364 
365 };
366 
367 class QueryTeleServiceClient : virtual public QueryTeleServiceIf
368 {
369 public:
QueryTeleServiceClient(boost::shared_ptr<::apache::thrift::protocol::TProtocol> prot)370     QueryTeleServiceClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) :
371         piprot_(prot),
372         poprot_(prot)
373     {
374         iprot_ = prot.get();
375         oprot_ = prot.get();
376     }
QueryTeleServiceClient(boost::shared_ptr<::apache::thrift::protocol::TProtocol> iprot,boost::shared_ptr<::apache::thrift::protocol::TProtocol> oprot)377     QueryTeleServiceClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) :
378         piprot_(iprot),
379         poprot_(oprot)
380     {
381         iprot_ = iprot.get();
382         oprot_ = oprot.get();
383     }
getInputProtocol()384     boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol()
385     {
386         return piprot_;
387     }
getOutputProtocol()388     boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol()
389     {
390         return poprot_;
391     }
392     void postQuery(const QueryTele& query);
393     void send_postQuery(const QueryTele& query);
394     void recv_postQuery();
395     void postStep(const StepTele& query);
396     void send_postStep(const StepTele& query);
397     void recv_postStep();
398     void postImport(const ImportTele& query);
399     void send_postImport(const ImportTele& query);
400     void recv_postImport();
401 protected:
402     boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
403     boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
404     ::apache::thrift::protocol::TProtocol* iprot_;
405     ::apache::thrift::protocol::TProtocol* oprot_;
406 };
407 
408 class QueryTeleServiceProcessor : public ::apache::thrift::TDispatchProcessor
409 {
410 protected:
411     boost::shared_ptr<QueryTeleServiceIf> iface_;
412     virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext);
413 private:
414     typedef  void (QueryTeleServiceProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
415     typedef std::map<std::string, ProcessFunction> ProcessMap;
416     ProcessMap processMap_;
417     void process_postQuery(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
418     void process_postStep(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
419     void process_postImport(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
420 public:
QueryTeleServiceProcessor(boost::shared_ptr<QueryTeleServiceIf> iface)421     QueryTeleServiceProcessor(boost::shared_ptr<QueryTeleServiceIf> iface) :
422         iface_(iface)
423     {
424         processMap_["postQuery"] = &QueryTeleServiceProcessor::process_postQuery;
425         processMap_["postStep"] = &QueryTeleServiceProcessor::process_postStep;
426         processMap_["postImport"] = &QueryTeleServiceProcessor::process_postImport;
427     }
428 
~QueryTeleServiceProcessor()429     virtual ~QueryTeleServiceProcessor() {}
430 };
431 
432 class QueryTeleServiceProcessorFactory : public ::apache::thrift::TProcessorFactory
433 {
434 public:
QueryTeleServiceProcessorFactory(const::boost::shared_ptr<QueryTeleServiceIfFactory> & handlerFactory)435     QueryTeleServiceProcessorFactory(const ::boost::shared_ptr< QueryTeleServiceIfFactory >& handlerFactory) :
436         handlerFactory_(handlerFactory) {}
437 
438     ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo);
439 
440 protected:
441     ::boost::shared_ptr< QueryTeleServiceIfFactory > handlerFactory_;
442 };
443 
444 class QueryTeleServiceMultiface : virtual public QueryTeleServiceIf
445 {
446 public:
QueryTeleServiceMultiface(std::vector<boost::shared_ptr<QueryTeleServiceIf>> & ifaces)447     QueryTeleServiceMultiface(std::vector<boost::shared_ptr<QueryTeleServiceIf> >& ifaces) : ifaces_(ifaces)
448     {
449     }
~QueryTeleServiceMultiface()450     virtual ~QueryTeleServiceMultiface() {}
451 protected:
452     std::vector<boost::shared_ptr<QueryTeleServiceIf> > ifaces_;
QueryTeleServiceMultiface()453     QueryTeleServiceMultiface() {}
add(boost::shared_ptr<QueryTeleServiceIf> iface)454     void add(boost::shared_ptr<QueryTeleServiceIf> iface)
455     {
456         ifaces_.push_back(iface);
457     }
458 public:
postQuery(const QueryTele & query)459     void postQuery(const QueryTele& query)
460     {
461         size_t sz = ifaces_.size();
462         size_t i = 0;
463 
464         for (; i < (sz - 1); ++i)
465         {
466             ifaces_[i]->postQuery(query);
467         }
468 
469         ifaces_[i]->postQuery(query);
470     }
471 
postStep(const StepTele & query)472     void postStep(const StepTele& query)
473     {
474         size_t sz = ifaces_.size();
475         size_t i = 0;
476 
477         for (; i < (sz - 1); ++i)
478         {
479             ifaces_[i]->postStep(query);
480         }
481 
482         ifaces_[i]->postStep(query);
483     }
484 
postImport(const ImportTele & query)485     void postImport(const ImportTele& query)
486     {
487         size_t sz = ifaces_.size();
488         size_t i = 0;
489 
490         for (; i < (sz - 1); ++i)
491         {
492             ifaces_[i]->postImport(query);
493         }
494 
495         ifaces_[i]->postImport(query);
496     }
497 
498 };
499 
500 } // namespace
501 
502 #endif
503