/**
 * Autogenerated by Thrift Compiler (0.14.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 <memory>
#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() noexcept;
  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() noexcept;
  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() noexcept;
   ::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() noexcept;
  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, std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync)
{
    setProtocol(prot);
  }
  AgentConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot, std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync)
{
    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_;
  std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync_;
};

#ifdef _MSC_VER
  #pragma warning( pop )
#endif

}}} // namespace

#endif
