2 * Autogenerated by Thrift Compiler (0.11.0)
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
7 #ifndef ZipkinCollector_H
8 #define ZipkinCollector_H
10 #include <thrift/TDispatchProcessor.h>
11 #include <thrift/async/TConcurrentClientSyncInfo.h>
12 #include "zipkincore_types.h"
14 namespace twitter
{ namespace zipkin
{ namespace thrift
{
17 #pragma warning( push )
18 #pragma warning (disable : 4250 ) //inheriting methods via dominance
21 class ZipkinCollectorIf
{
23 virtual ~ZipkinCollectorIf() {}
24 virtual void submitZipkinBatch(std::vector
<Response
> & _return
, const std::vector
<Span
> & spans
) = 0;
27 class ZipkinCollectorIfFactory
{
29 typedef ZipkinCollectorIf Handler
;
31 virtual ~ZipkinCollectorIfFactory() {}
33 virtual ZipkinCollectorIf
* getHandler(const ::apache::thrift::TConnectionInfo
& connInfo
) = 0;
34 virtual void releaseHandler(ZipkinCollectorIf
* /* handler */) = 0;
37 class ZipkinCollectorIfSingletonFactory
: virtual public ZipkinCollectorIfFactory
{
39 ZipkinCollectorIfSingletonFactory(const ::std::shared_ptr
<ZipkinCollectorIf
>& iface
) : iface_(iface
) {}
40 virtual ~ZipkinCollectorIfSingletonFactory() {}
42 virtual ZipkinCollectorIf
* getHandler(const ::apache::thrift::TConnectionInfo
&) {
45 virtual void releaseHandler(ZipkinCollectorIf
* /* handler */) {}
48 ::std::shared_ptr
<ZipkinCollectorIf
> iface_
;
51 class ZipkinCollectorNull
: virtual public ZipkinCollectorIf
{
53 virtual ~ZipkinCollectorNull() {}
54 void submitZipkinBatch(std::vector
<Response
> & /* _return */, const std::vector
<Span
> & /* spans */) {
59 typedef struct _ZipkinCollector_submitZipkinBatch_args__isset
{
60 _ZipkinCollector_submitZipkinBatch_args__isset() : spans(false) {}
62 } _ZipkinCollector_submitZipkinBatch_args__isset
;
64 class ZipkinCollector_submitZipkinBatch_args
{
67 ZipkinCollector_submitZipkinBatch_args(const ZipkinCollector_submitZipkinBatch_args
&);
68 ZipkinCollector_submitZipkinBatch_args
& operator=(const ZipkinCollector_submitZipkinBatch_args
&);
69 ZipkinCollector_submitZipkinBatch_args() {
72 virtual ~ZipkinCollector_submitZipkinBatch_args() throw();
73 std::vector
<Span
> spans
;
75 _ZipkinCollector_submitZipkinBatch_args__isset __isset
;
77 void __set_spans(const std::vector
<Span
> & val
);
79 bool operator == (const ZipkinCollector_submitZipkinBatch_args
& rhs
) const
81 if (!(spans
== rhs
.spans
))
85 bool operator != (const ZipkinCollector_submitZipkinBatch_args
&rhs
) const {
86 return !(*this == rhs
);
89 bool operator < (const ZipkinCollector_submitZipkinBatch_args
& ) const;
91 uint32_t read(::apache::thrift::protocol::TProtocol
* iprot
);
92 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
97 class ZipkinCollector_submitZipkinBatch_pargs
{
101 virtual ~ZipkinCollector_submitZipkinBatch_pargs() throw();
102 const std::vector
<Span
> * spans
;
104 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
108 typedef struct _ZipkinCollector_submitZipkinBatch_result__isset
{
109 _ZipkinCollector_submitZipkinBatch_result__isset() : success(false) {}
111 } _ZipkinCollector_submitZipkinBatch_result__isset
;
113 class ZipkinCollector_submitZipkinBatch_result
{
116 ZipkinCollector_submitZipkinBatch_result(const ZipkinCollector_submitZipkinBatch_result
&);
117 ZipkinCollector_submitZipkinBatch_result
& operator=(const ZipkinCollector_submitZipkinBatch_result
&);
118 ZipkinCollector_submitZipkinBatch_result() {
121 virtual ~ZipkinCollector_submitZipkinBatch_result() throw();
122 std::vector
<Response
> success
;
124 _ZipkinCollector_submitZipkinBatch_result__isset __isset
;
126 void __set_success(const std::vector
<Response
> & val
);
128 bool operator == (const ZipkinCollector_submitZipkinBatch_result
& rhs
) const
130 if (!(success
== rhs
.success
))
134 bool operator != (const ZipkinCollector_submitZipkinBatch_result
&rhs
) const {
135 return !(*this == rhs
);
138 bool operator < (const ZipkinCollector_submitZipkinBatch_result
& ) const;
140 uint32_t read(::apache::thrift::protocol::TProtocol
* iprot
);
141 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
145 typedef struct _ZipkinCollector_submitZipkinBatch_presult__isset
{
146 _ZipkinCollector_submitZipkinBatch_presult__isset() : success(false) {}
148 } _ZipkinCollector_submitZipkinBatch_presult__isset
;
150 class ZipkinCollector_submitZipkinBatch_presult
{
154 virtual ~ZipkinCollector_submitZipkinBatch_presult() throw();
155 std::vector
<Response
> * success
;
157 _ZipkinCollector_submitZipkinBatch_presult__isset __isset
;
159 uint32_t read(::apache::thrift::protocol::TProtocol
* iprot
);
163 class ZipkinCollectorClient
: virtual public ZipkinCollectorIf
{
165 ZipkinCollectorClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
168 ZipkinCollectorClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
169 setProtocol(iprot
,oprot
);
172 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
173 setProtocol(prot
,prot
);
175 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
178 iprot_
= iprot
.get();
179 oprot_
= oprot
.get();
182 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getInputProtocol() {
185 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getOutputProtocol() {
188 void submitZipkinBatch(std::vector
<Response
> & _return
, const std::vector
<Span
> & spans
);
189 void send_submitZipkinBatch(const std::vector
<Span
> & spans
);
190 void recv_submitZipkinBatch(std::vector
<Response
> & _return
);
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_
;
198 class ZipkinCollectorProcessor
: public ::apache::thrift::TDispatchProcessor
{
200 ::std::shared_ptr
<ZipkinCollectorIf
> iface_
;
201 virtual bool dispatchCall(::apache::thrift::protocol::TProtocol
* iprot
, ::apache::thrift::protocol::TProtocol
* oprot
, const std::string
& fname
, int32_t seqid
, void* callContext
);
203 typedef void (ZipkinCollectorProcessor::*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_submitZipkinBatch(int32_t seqid
, ::apache::thrift::protocol::TProtocol
* iprot
, ::apache::thrift::protocol::TProtocol
* oprot
, void* callContext
);
208 ZipkinCollectorProcessor(::std::shared_ptr
<ZipkinCollectorIf
> iface
) :
210 processMap_
["submitZipkinBatch"] = &ZipkinCollectorProcessor::process_submitZipkinBatch
;
213 virtual ~ZipkinCollectorProcessor() {}
216 class ZipkinCollectorProcessorFactory
: public ::apache::thrift::TProcessorFactory
{
218 ZipkinCollectorProcessorFactory(const ::std::shared_ptr
< ZipkinCollectorIfFactory
>& handlerFactory
) :
219 handlerFactory_(handlerFactory
) {}
221 ::std::shared_ptr
< ::apache::thrift::TProcessor
> getProcessor(const ::apache::thrift::TConnectionInfo
& connInfo
);
224 ::std::shared_ptr
< ZipkinCollectorIfFactory
> handlerFactory_
;
227 class ZipkinCollectorMultiface
: virtual public ZipkinCollectorIf
{
229 ZipkinCollectorMultiface(std::vector
<std::shared_ptr
<ZipkinCollectorIf
> >& ifaces
) : ifaces_(ifaces
) {
231 virtual ~ZipkinCollectorMultiface() {}
233 std::vector
<std::shared_ptr
<ZipkinCollectorIf
> > ifaces_
;
234 ZipkinCollectorMultiface() {}
235 void add(::std::shared_ptr
<ZipkinCollectorIf
> iface
) {
236 ifaces_
.push_back(iface
);
239 void submitZipkinBatch(std::vector
<Response
> & _return
, const std::vector
<Span
> & spans
) {
240 size_t sz
= ifaces_
.size();
242 for (; i
< (sz
- 1); ++i
) {
243 ifaces_
[i
]->submitZipkinBatch(_return
, spans
);
245 ifaces_
[i
]->submitZipkinBatch(_return
, spans
);
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 ZipkinCollectorConcurrentClient
: virtual public ZipkinCollectorIf
{
256 ZipkinCollectorConcurrentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
259 ZipkinCollectorConcurrentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
260 setProtocol(iprot
,oprot
);
263 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
264 setProtocol(prot
,prot
);
266 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
269 iprot_
= iprot
.get();
270 oprot_
= oprot
.get();
273 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getInputProtocol() {
276 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getOutputProtocol() {
279 void submitZipkinBatch(std::vector
<Response
> & _return
, const std::vector
<Span
> & spans
);
280 int32_t send_submitZipkinBatch(const std::vector
<Span
> & spans
);
281 void recv_submitZipkinBatch(std::vector
<Response
> & _return
, const int32_t seqid
);
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_
;
291 #pragma warning( pop )