2 * Autogenerated by Thrift Compiler (0.11.0)
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
10 #include <thrift/TDispatchProcessor.h>
11 #include <thrift/async/TConcurrentClientSyncInfo.h>
12 #include "agent_types.h"
14 namespace jaegertracing
{ namespace agent
{ namespace thrift
{
17 #pragma warning( push )
18 #pragma warning (disable : 4250 ) //inheriting methods via dominance
24 virtual void emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
) = 0;
25 virtual void emitBatch(const ::jaegertracing::thrift::Batch
& batch
) = 0;
28 class AgentIfFactory
{
30 typedef AgentIf Handler
;
32 virtual ~AgentIfFactory() {}
34 virtual AgentIf
* getHandler(const ::apache::thrift::TConnectionInfo
& connInfo
) = 0;
35 virtual void releaseHandler(AgentIf
* /* handler */) = 0;
38 class AgentIfSingletonFactory
: virtual public AgentIfFactory
{
40 AgentIfSingletonFactory(const ::std::shared_ptr
<AgentIf
>& iface
) : iface_(iface
) {}
41 virtual ~AgentIfSingletonFactory() {}
43 virtual AgentIf
* getHandler(const ::apache::thrift::TConnectionInfo
&) {
46 virtual void releaseHandler(AgentIf
* /* handler */) {}
49 ::std::shared_ptr
<AgentIf
> iface_
;
52 class AgentNull
: virtual public AgentIf
{
54 virtual ~AgentNull() {}
55 void emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & /* spans */) {
58 void emitBatch(const ::jaegertracing::thrift::Batch
& /* batch */) {
63 typedef struct _Agent_emitZipkinBatch_args__isset
{
64 _Agent_emitZipkinBatch_args__isset() : spans(false) {}
66 } _Agent_emitZipkinBatch_args__isset
;
68 class Agent_emitZipkinBatch_args
{
71 Agent_emitZipkinBatch_args(const Agent_emitZipkinBatch_args
&);
72 Agent_emitZipkinBatch_args
& operator=(const Agent_emitZipkinBatch_args
&);
73 Agent_emitZipkinBatch_args() {
76 virtual ~Agent_emitZipkinBatch_args() throw();
77 std::vector
< ::twitter::zipkin::thrift::Span
> spans
;
79 _Agent_emitZipkinBatch_args__isset __isset
;
81 void __set_spans(const std::vector
< ::twitter::zipkin::thrift::Span
> & val
);
83 bool operator == (const Agent_emitZipkinBatch_args
& rhs
) const
85 if (!(spans
== rhs
.spans
))
89 bool operator != (const Agent_emitZipkinBatch_args
&rhs
) const {
90 return !(*this == rhs
);
93 bool operator < (const Agent_emitZipkinBatch_args
& ) const;
95 uint32_t read(::apache::thrift::protocol::TProtocol
* iprot
);
96 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
101 class Agent_emitZipkinBatch_pargs
{
105 virtual ~Agent_emitZipkinBatch_pargs() throw();
106 const std::vector
< ::twitter::zipkin::thrift::Span
> * spans
;
108 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
112 typedef struct _Agent_emitBatch_args__isset
{
113 _Agent_emitBatch_args__isset() : batch(false) {}
115 } _Agent_emitBatch_args__isset
;
117 class Agent_emitBatch_args
{
120 Agent_emitBatch_args(const Agent_emitBatch_args
&);
121 Agent_emitBatch_args
& operator=(const Agent_emitBatch_args
&);
122 Agent_emitBatch_args() {
125 virtual ~Agent_emitBatch_args() throw();
126 ::jaegertracing::thrift::Batch batch
;
128 _Agent_emitBatch_args__isset __isset
;
130 void __set_batch(const ::jaegertracing::thrift::Batch
& val
);
132 bool operator == (const Agent_emitBatch_args
& rhs
) const
134 if (!(batch
== rhs
.batch
))
138 bool operator != (const Agent_emitBatch_args
&rhs
) const {
139 return !(*this == rhs
);
142 bool operator < (const Agent_emitBatch_args
& ) const;
144 uint32_t read(::apache::thrift::protocol::TProtocol
* iprot
);
145 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
150 class Agent_emitBatch_pargs
{
154 virtual ~Agent_emitBatch_pargs() throw();
155 const ::jaegertracing::thrift::Batch
* batch
;
157 uint32_t write(::apache::thrift::protocol::TProtocol
* oprot
) const;
161 class AgentClient
: virtual public AgentIf
{
163 AgentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
166 AgentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
167 setProtocol(iprot
,oprot
);
170 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
171 setProtocol(prot
,prot
);
173 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
176 iprot_
= iprot
.get();
177 oprot_
= oprot
.get();
180 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getInputProtocol() {
183 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getOutputProtocol() {
186 void emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
);
187 void send_emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
);
188 void emitBatch(const ::jaegertracing::thrift::Batch
& batch
);
189 void send_emitBatch(const ::jaegertracing::thrift::Batch
& batch
);
191 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> piprot_
;
192 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> poprot_
;
193 ::apache::thrift::protocol::TProtocol
* iprot_
;
194 ::apache::thrift::protocol::TProtocol
* oprot_
;
197 class AgentProcessor
: public ::apache::thrift::TDispatchProcessor
{
199 ::std::shared_ptr
<AgentIf
> iface_
;
200 virtual bool dispatchCall(::apache::thrift::protocol::TProtocol
* iprot
, ::apache::thrift::protocol::TProtocol
* oprot
, const std::string
& fname
, int32_t seqid
, void* callContext
);
202 typedef void (AgentProcessor::*ProcessFunction
)(int32_t, ::apache::thrift::protocol::TProtocol
*, ::apache::thrift::protocol::TProtocol
*, void*);
203 typedef std::map
<std::string
, ProcessFunction
> ProcessMap
;
204 ProcessMap processMap_
;
205 void process_emitZipkinBatch(int32_t seqid
, ::apache::thrift::protocol::TProtocol
* iprot
, ::apache::thrift::protocol::TProtocol
* oprot
, void* callContext
);
206 void process_emitBatch(int32_t seqid
, ::apache::thrift::protocol::TProtocol
* iprot
, ::apache::thrift::protocol::TProtocol
* oprot
, void* callContext
);
208 AgentProcessor(::std::shared_ptr
<AgentIf
> iface
) :
210 processMap_
["emitZipkinBatch"] = &AgentProcessor::process_emitZipkinBatch
;
211 processMap_
["emitBatch"] = &AgentProcessor::process_emitBatch
;
214 virtual ~AgentProcessor() {}
217 class AgentProcessorFactory
: public ::apache::thrift::TProcessorFactory
{
219 AgentProcessorFactory(const ::std::shared_ptr
< AgentIfFactory
>& handlerFactory
) :
220 handlerFactory_(handlerFactory
) {}
222 ::std::shared_ptr
< ::apache::thrift::TProcessor
> getProcessor(const ::apache::thrift::TConnectionInfo
& connInfo
);
225 ::std::shared_ptr
< AgentIfFactory
> handlerFactory_
;
228 class AgentMultiface
: virtual public AgentIf
{
230 AgentMultiface(std::vector
<std::shared_ptr
<AgentIf
> >& ifaces
) : ifaces_(ifaces
) {
232 virtual ~AgentMultiface() {}
234 std::vector
<std::shared_ptr
<AgentIf
> > ifaces_
;
236 void add(::std::shared_ptr
<AgentIf
> iface
) {
237 ifaces_
.push_back(iface
);
240 void emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
) {
241 size_t sz
= ifaces_
.size();
243 for (; i
< (sz
- 1); ++i
) {
244 ifaces_
[i
]->emitZipkinBatch(spans
);
246 ifaces_
[i
]->emitZipkinBatch(spans
);
249 void emitBatch(const ::jaegertracing::thrift::Batch
& batch
) {
250 size_t sz
= ifaces_
.size();
252 for (; i
< (sz
- 1); ++i
) {
253 ifaces_
[i
]->emitBatch(batch
);
255 ifaces_
[i
]->emitBatch(batch
);
260 // The 'concurrent' client is a thread safe client that correctly handles
261 // out of order responses. It is slower than the regular client, so should
262 // only be used when you need to share a connection among multiple threads
263 class AgentConcurrentClient
: virtual public AgentIf
{
265 AgentConcurrentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
268 AgentConcurrentClient(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
269 setProtocol(iprot
,oprot
);
272 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> prot
) {
273 setProtocol(prot
,prot
);
275 void setProtocol(std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> iprot
, std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> oprot
) {
278 iprot_
= iprot
.get();
279 oprot_
= oprot
.get();
282 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getInputProtocol() {
285 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> getOutputProtocol() {
288 void emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
);
289 void send_emitZipkinBatch(const std::vector
< ::twitter::zipkin::thrift::Span
> & spans
);
290 void emitBatch(const ::jaegertracing::thrift::Batch
& batch
);
291 void send_emitBatch(const ::jaegertracing::thrift::Batch
& batch
);
293 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> piprot_
;
294 std::shared_ptr
< ::apache::thrift::protocol::TProtocol
> poprot_
;
295 ::apache::thrift::protocol::TProtocol
* iprot_
;
296 ::apache::thrift::protocol::TProtocol
* oprot_
;
297 ::apache::thrift::async::TConcurrentClientSyncInfo sync_
;
301 #pragma warning( pop )