summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/jaeger-client-cpp/src/jaegertracing/thrift-gen/Agent.h
blob: daa5678964ca861269474cf3458d24793ac2226b (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
297
298
299
300
301
302
303
304
305
306
/**
 * Autogenerated by Thrift Compiler (0.11.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef Agent_H
#define Agent_H

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

namespace jaegertracing { namespace agent { namespace thrift {

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

class AgentIf {
 public:
  virtual ~AgentIf() {}
  virtual void emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans) = 0;
  virtual void emitBatch(const  ::jaegertracing::thrift::Batch& batch) = 0;
};

class AgentIfFactory {
 public:
  typedef AgentIf Handler;

  virtual ~AgentIfFactory() {}

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

class AgentIfSingletonFactory : virtual public AgentIfFactory {
 public:
  AgentIfSingletonFactory(const ::std::shared_ptr<AgentIf>& iface) : iface_(iface) {}
  virtual ~AgentIfSingletonFactory() {}

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

 protected:
  ::std::shared_ptr<AgentIf> iface_;
};

class AgentNull : virtual public AgentIf {
 public:
  virtual ~AgentNull() {}
  void emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & /* spans */) {
    return;
  }
  void emitBatch(const  ::jaegertracing::thrift::Batch& /* batch */) {
    return;
  }
};

typedef struct _Agent_emitZipkinBatch_args__isset {
  _Agent_emitZipkinBatch_args__isset() : spans(false) {}
  bool spans :1;
} _Agent_emitZipkinBatch_args__isset;

class Agent_emitZipkinBatch_args {
 public:

  Agent_emitZipkinBatch_args(const Agent_emitZipkinBatch_args&);
  Agent_emitZipkinBatch_args& operator=(const Agent_emitZipkinBatch_args&);
  Agent_emitZipkinBatch_args() {
  }

  virtual ~Agent_emitZipkinBatch_args() throw();
  std::vector< ::twitter::zipkin::thrift::Span>  spans;

  _Agent_emitZipkinBatch_args__isset __isset;

  void __set_spans(const std::vector< ::twitter::zipkin::thrift::Span> & val);

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

  bool operator < (const Agent_emitZipkinBatch_args & ) const;

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

};


class Agent_emitZipkinBatch_pargs {
 public:


  virtual ~Agent_emitZipkinBatch_pargs() throw();
  const std::vector< ::twitter::zipkin::thrift::Span> * spans;

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

};

typedef struct _Agent_emitBatch_args__isset {
  _Agent_emitBatch_args__isset() : batch(false) {}
  bool batch :1;
} _Agent_emitBatch_args__isset;

class Agent_emitBatch_args {
 public:

  Agent_emitBatch_args(const Agent_emitBatch_args&);
  Agent_emitBatch_args& operator=(const Agent_emitBatch_args&);
  Agent_emitBatch_args() {
  }

  virtual ~Agent_emitBatch_args() throw();
   ::jaegertracing::thrift::Batch batch;

  _Agent_emitBatch_args__isset __isset;

  void __set_batch(const  ::jaegertracing::thrift::Batch& val);

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

  bool operator < (const Agent_emitBatch_args & ) const;

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

};


class Agent_emitBatch_pargs {
 public:


  virtual ~Agent_emitBatch_pargs() throw();
  const  ::jaegertracing::thrift::Batch* batch;

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

};

class AgentClient : virtual public AgentIf {
 public:
  AgentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  AgentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans);
  void send_emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans);
  void emitBatch(const  ::jaegertracing::thrift::Batch& batch);
  void send_emitBatch(const  ::jaegertracing::thrift::Batch& batch);
 protected:
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
};

class AgentProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  ::std::shared_ptr<AgentIf> 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 (AgentProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_emitZipkinBatch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_emitBatch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
 public:
  AgentProcessor(::std::shared_ptr<AgentIf> iface) :
    iface_(iface) {
    processMap_["emitZipkinBatch"] = &AgentProcessor::process_emitZipkinBatch;
    processMap_["emitBatch"] = &AgentProcessor::process_emitBatch;
  }

  virtual ~AgentProcessor() {}
};

class AgentProcessorFactory : public ::apache::thrift::TProcessorFactory {
 public:
  AgentProcessorFactory(const ::std::shared_ptr< AgentIfFactory >& handlerFactory) :
      handlerFactory_(handlerFactory) {}

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

 protected:
  ::std::shared_ptr< AgentIfFactory > handlerFactory_;
};

class AgentMultiface : virtual public AgentIf {
 public:
  AgentMultiface(std::vector<std::shared_ptr<AgentIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~AgentMultiface() {}
 protected:
  std::vector<std::shared_ptr<AgentIf> > ifaces_;
  AgentMultiface() {}
  void add(::std::shared_ptr<AgentIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  void emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->emitZipkinBatch(spans);
    }
    ifaces_[i]->emitZipkinBatch(spans);
  }

  void emitBatch(const  ::jaegertracing::thrift::Batch& batch) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->emitBatch(batch);
    }
    ifaces_[i]->emitBatch(batch);
  }

};

// 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 AgentConcurrentClient : virtual public AgentIf {
 public:
  AgentConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  AgentConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans);
  void send_emitZipkinBatch(const std::vector< ::twitter::zipkin::thrift::Span> & spans);
  void emitBatch(const  ::jaegertracing::thrift::Batch& batch);
  void send_emitBatch(const  ::jaegertracing::thrift::Batch& batch);
 protected:
  std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  std::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