]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /** |
2 | * Autogenerated by Thrift Compiler (0.11.0) | |
3 | * | |
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | |
5 | * @generated | |
6 | */ | |
7 | #ifndef Collector_H | |
8 | #define Collector_H | |
9 | ||
10 | #include <thrift/TDispatchProcessor.h> | |
11 | #include <thrift/async/TConcurrentClientSyncInfo.h> | |
12 | #include "jaeger_types.h" | |
13 | ||
14 | namespace jaegertracing { namespace thrift { | |
15 | ||
16 | #ifdef _MSC_VER | |
17 | #pragma warning( push ) | |
18 | #pragma warning (disable : 4250 ) //inheriting methods via dominance | |
19 | #endif | |
20 | ||
21 | class CollectorIf { | |
22 | public: | |
23 | virtual ~CollectorIf() {} | |
24 | virtual void submitBatches(std::vector<BatchSubmitResponse> & _return, const std::vector<Batch> & batches) = 0; | |
25 | }; | |
26 | ||
27 | class CollectorIfFactory { | |
28 | public: | |
29 | typedef CollectorIf Handler; | |
30 | ||
31 | virtual ~CollectorIfFactory() {} | |
32 | ||
33 | virtual CollectorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; | |
34 | virtual void releaseHandler(CollectorIf* /* handler */) = 0; | |
35 | }; | |
36 | ||
37 | class CollectorIfSingletonFactory : virtual public CollectorIfFactory { | |
38 | public: | |
39 | CollectorIfSingletonFactory(const ::std::shared_ptr<CollectorIf>& iface) : iface_(iface) {} | |
40 | virtual ~CollectorIfSingletonFactory() {} | |
41 | ||
42 | virtual CollectorIf* getHandler(const ::apache::thrift::TConnectionInfo&) { | |
43 | return iface_.get(); | |
44 | } | |
45 | virtual void releaseHandler(CollectorIf* /* handler */) {} | |
46 | ||
47 | protected: | |
48 | ::std::shared_ptr<CollectorIf> iface_; | |
49 | }; | |
50 | ||
51 | class CollectorNull : virtual public CollectorIf { | |
52 | public: | |
53 | virtual ~CollectorNull() {} | |
54 | void submitBatches(std::vector<BatchSubmitResponse> & /* _return */, const std::vector<Batch> & /* batches */) { | |
55 | return; | |
56 | } | |
57 | }; | |
58 | ||
59 | typedef struct _Collector_submitBatches_args__isset { | |
60 | _Collector_submitBatches_args__isset() : batches(false) {} | |
61 | bool batches :1; | |
62 | } _Collector_submitBatches_args__isset; | |
63 | ||
64 | class Collector_submitBatches_args { | |
65 | public: | |
66 | ||
67 | Collector_submitBatches_args(const Collector_submitBatches_args&); | |
68 | Collector_submitBatches_args& operator=(const Collector_submitBatches_args&); | |
69 | Collector_submitBatches_args() { | |
70 | } | |
71 | ||
72 | virtual ~Collector_submitBatches_args() throw(); | |
73 | std::vector<Batch> batches; | |
74 | ||
75 | _Collector_submitBatches_args__isset __isset; | |
76 | ||
77 | void __set_batches(const std::vector<Batch> & val); | |
78 | ||
79 | bool operator == (const Collector_submitBatches_args & rhs) const | |
80 | { | |
81 | if (!(batches == rhs.batches)) | |
82 | return false; | |
83 | return true; | |
84 | } | |
85 | bool operator != (const Collector_submitBatches_args &rhs) const { | |
86 | return !(*this == rhs); | |
87 | } | |
88 | ||
89 | bool operator < (const Collector_submitBatches_args & ) const; | |
90 | ||
91 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
92 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
93 | ||
94 | }; | |
95 | ||
96 | ||
97 | class Collector_submitBatches_pargs { | |
98 | public: | |
99 | ||
100 | ||
101 | virtual ~Collector_submitBatches_pargs() throw(); | |
102 | const std::vector<Batch> * batches; | |
103 | ||
104 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
105 | ||
106 | }; | |
107 | ||
108 | typedef struct _Collector_submitBatches_result__isset { | |
109 | _Collector_submitBatches_result__isset() : success(false) {} | |
110 | bool success :1; | |
111 | } _Collector_submitBatches_result__isset; | |
112 | ||
113 | class Collector_submitBatches_result { | |
114 | public: | |
115 | ||
116 | Collector_submitBatches_result(const Collector_submitBatches_result&); | |
117 | Collector_submitBatches_result& operator=(const Collector_submitBatches_result&); | |
118 | Collector_submitBatches_result() { | |
119 | } | |
120 | ||
121 | virtual ~Collector_submitBatches_result() throw(); | |
122 | std::vector<BatchSubmitResponse> success; | |
123 | ||
124 | _Collector_submitBatches_result__isset __isset; | |
125 | ||
126 | void __set_success(const std::vector<BatchSubmitResponse> & val); | |
127 | ||
128 | bool operator == (const Collector_submitBatches_result & rhs) const | |
129 | { | |
130 | if (!(success == rhs.success)) | |
131 | return false; | |
132 | return true; | |
133 | } | |
134 | bool operator != (const Collector_submitBatches_result &rhs) const { | |
135 | return !(*this == rhs); | |
136 | } | |
137 | ||
138 | bool operator < (const Collector_submitBatches_result & ) const; | |
139 | ||
140 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
141 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
142 | ||
143 | }; | |
144 | ||
145 | typedef struct _Collector_submitBatches_presult__isset { | |
146 | _Collector_submitBatches_presult__isset() : success(false) {} | |
147 | bool success :1; | |
148 | } _Collector_submitBatches_presult__isset; | |
149 | ||
150 | class Collector_submitBatches_presult { | |
151 | public: | |
152 | ||
153 | ||
154 | virtual ~Collector_submitBatches_presult() throw(); | |
155 | std::vector<BatchSubmitResponse> * success; | |
156 | ||
157 | _Collector_submitBatches_presult__isset __isset; | |
158 | ||
159 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
160 | ||
161 | }; | |
162 | ||
163 | class CollectorClient : virtual public CollectorIf { | |
164 | public: | |
165 | CollectorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
166 | setProtocol(prot); | |
167 | } | |
168 | CollectorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
169 | setProtocol(iprot,oprot); | |
170 | } | |
171 | private: | |
172 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
173 | setProtocol(prot,prot); | |
174 | } | |
175 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
176 | piprot_=iprot; | |
177 | poprot_=oprot; | |
178 | iprot_ = iprot.get(); | |
179 | oprot_ = oprot.get(); | |
180 | } | |
181 | public: | |
182 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { | |
183 | return piprot_; | |
184 | } | |
185 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { | |
186 | return poprot_; | |
187 | } | |
188 | void submitBatches(std::vector<BatchSubmitResponse> & _return, const std::vector<Batch> & batches); | |
189 | void send_submitBatches(const std::vector<Batch> & batches); | |
190 | void recv_submitBatches(std::vector<BatchSubmitResponse> & _return); | |
191 | protected: | |
192 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; | |
193 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; | |
194 | ::apache::thrift::protocol::TProtocol* iprot_; | |
195 | ::apache::thrift::protocol::TProtocol* oprot_; | |
196 | }; | |
197 | ||
198 | class CollectorProcessor : public ::apache::thrift::TDispatchProcessor { | |
199 | protected: | |
200 | ::std::shared_ptr<CollectorIf> iface_; | |
201 | virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); | |
202 | private: | |
203 | typedef void (CollectorProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); | |
204 | typedef std::map<std::string, ProcessFunction> ProcessMap; | |
205 | ProcessMap processMap_; | |
206 | void process_submitBatches(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); | |
207 | public: | |
208 | CollectorProcessor(::std::shared_ptr<CollectorIf> iface) : | |
209 | iface_(iface) { | |
210 | processMap_["submitBatches"] = &CollectorProcessor::process_submitBatches; | |
211 | } | |
212 | ||
213 | virtual ~CollectorProcessor() {} | |
214 | }; | |
215 | ||
216 | class CollectorProcessorFactory : public ::apache::thrift::TProcessorFactory { | |
217 | public: | |
218 | CollectorProcessorFactory(const ::std::shared_ptr< CollectorIfFactory >& handlerFactory) : | |
219 | handlerFactory_(handlerFactory) {} | |
220 | ||
221 | ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); | |
222 | ||
223 | protected: | |
224 | ::std::shared_ptr< CollectorIfFactory > handlerFactory_; | |
225 | }; | |
226 | ||
227 | class CollectorMultiface : virtual public CollectorIf { | |
228 | public: | |
229 | CollectorMultiface(std::vector<std::shared_ptr<CollectorIf> >& ifaces) : ifaces_(ifaces) { | |
230 | } | |
231 | virtual ~CollectorMultiface() {} | |
232 | protected: | |
233 | std::vector<std::shared_ptr<CollectorIf> > ifaces_; | |
234 | CollectorMultiface() {} | |
235 | void add(::std::shared_ptr<CollectorIf> iface) { | |
236 | ifaces_.push_back(iface); | |
237 | } | |
238 | public: | |
239 | void submitBatches(std::vector<BatchSubmitResponse> & _return, const std::vector<Batch> & batches) { | |
240 | size_t sz = ifaces_.size(); | |
241 | size_t i = 0; | |
242 | for (; i < (sz - 1); ++i) { | |
243 | ifaces_[i]->submitBatches(_return, batches); | |
244 | } | |
245 | ifaces_[i]->submitBatches(_return, batches); | |
246 | return; | |
247 | } | |
248 | ||
249 | }; | |
250 | ||
251 | // The 'concurrent' client is a thread safe client that correctly handles | |
252 | // out of order responses. It is slower than the regular client, so should | |
253 | // only be used when you need to share a connection among multiple threads | |
254 | class CollectorConcurrentClient : virtual public CollectorIf { | |
255 | public: | |
256 | CollectorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
257 | setProtocol(prot); | |
258 | } | |
259 | CollectorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
260 | setProtocol(iprot,oprot); | |
261 | } | |
262 | private: | |
263 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
264 | setProtocol(prot,prot); | |
265 | } | |
266 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
267 | piprot_=iprot; | |
268 | poprot_=oprot; | |
269 | iprot_ = iprot.get(); | |
270 | oprot_ = oprot.get(); | |
271 | } | |
272 | public: | |
273 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { | |
274 | return piprot_; | |
275 | } | |
276 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { | |
277 | return poprot_; | |
278 | } | |
279 | void submitBatches(std::vector<BatchSubmitResponse> & _return, const std::vector<Batch> & batches); | |
280 | int32_t send_submitBatches(const std::vector<Batch> & batches); | |
281 | void recv_submitBatches(std::vector<BatchSubmitResponse> & _return, const int32_t seqid); | |
282 | protected: | |
283 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; | |
284 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; | |
285 | ::apache::thrift::protocol::TProtocol* iprot_; | |
286 | ::apache::thrift::protocol::TProtocol* oprot_; | |
287 | ::apache::thrift::async::TConcurrentClientSyncInfo sync_; | |
288 | }; | |
289 | ||
290 | #ifdef _MSC_VER | |
291 | #pragma warning( pop ) | |
292 | #endif | |
293 | ||
294 | }} // namespace | |
295 | ||
296 | #endif |