/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef ProducerService_H
#define ProducerService_H

#include <thrift/TDispatchProcessor.h>
#include "producerProxy_types.h"

namespace CarreraProducer {

class ProducerServiceIf {
 public:
  virtual ~ProducerServiceIf() {}
  virtual void sendSync(Result& _return, const Message& message, const int64_t timeout) = 0;
  virtual void sendBatchSync(Result& _return, const std::vector<Message> & messages) = 0;
  virtual void sendAsync(Result& _return, const Message& message) = 0;
  virtual void sendDelaySync(DelayResult& _return, const DelayMessage& delayMessage, const int64_t timeout) = 0;
};

class ProducerServiceIfFactory {
 public:
  typedef ProducerServiceIf Handler;

  virtual ~ProducerServiceIfFactory() {}

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

class ProducerServiceIfSingletonFactory : virtual public ProducerServiceIfFactory {
 public:
  ProducerServiceIfSingletonFactory(const boost::shared_ptr<ProducerServiceIf>& iface) : iface_(iface) {}
  virtual ~ProducerServiceIfSingletonFactory() {}

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

 protected:
  boost::shared_ptr<ProducerServiceIf> iface_;
};

class ProducerServiceNull : virtual public ProducerServiceIf {
 public:
  virtual ~ProducerServiceNull() {}
  void sendSync(Result& /* _return */, const Message& /* message */, const int64_t /* timeout */) {
    return;
  }
  void sendBatchSync(Result& /* _return */, const std::vector<Message> & /* messages */) {
    return;
  }
  void sendAsync(Result& /* _return */, const Message& /* message */) {
    return;
  }
  void sendDelaySync(DelayResult& /* _return */, const DelayMessage& /* delayMessage */, const int64_t /* timeout */) {
    return;
  }
};

typedef struct _ProducerService_sendSync_args__isset {
  _ProducerService_sendSync_args__isset() : message(false), timeout(false) {}
  bool message :1;
  bool timeout :1;
} _ProducerService_sendSync_args__isset;

class ProducerService_sendSync_args {
 public:

  static const char* ascii_fingerprint; // = "A4D71F6B130A4D6C6B3229BBE35EB976";
  static const uint8_t binary_fingerprint[16]; // = {0xA4,0xD7,0x1F,0x6B,0x13,0x0A,0x4D,0x6C,0x6B,0x32,0x29,0xBB,0xE3,0x5E,0xB9,0x76};

  ProducerService_sendSync_args(const ProducerService_sendSync_args&);
  ProducerService_sendSync_args& operator=(const ProducerService_sendSync_args&);
  ProducerService_sendSync_args() : timeout(0) {
  }

  virtual ~ProducerService_sendSync_args() throw();
  Message message;
  int64_t timeout;

  _ProducerService_sendSync_args__isset __isset;

  void __set_message(const Message& val);

  void __set_timeout(const int64_t val);

  bool operator == (const ProducerService_sendSync_args & rhs) const
  {
    if (!(message == rhs.message))
      return false;
    if (!(timeout == rhs.timeout))
      return false;
    return true;
  }
  bool operator != (const ProducerService_sendSync_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const ProducerService_sendSync_args & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendSync_args& obj);
};


class ProducerService_sendSync_pargs {
 public:

  static const char* ascii_fingerprint; // = "A4D71F6B130A4D6C6B3229BBE35EB976";
  static const uint8_t binary_fingerprint[16]; // = {0xA4,0xD7,0x1F,0x6B,0x13,0x0A,0x4D,0x6C,0x6B,0x32,0x29,0xBB,0xE3,0x5E,0xB9,0x76};


  virtual ~ProducerService_sendSync_pargs() throw();
  const Message* message;
  const int64_t* timeout;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendSync_pargs& obj);
};

typedef struct _ProducerService_sendSync_result__isset {
  _ProducerService_sendSync_result__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendSync_result__isset;

class ProducerService_sendSync_result {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};

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

  virtual ~ProducerService_sendSync_result() throw();
  Result success;

  _ProducerService_sendSync_result__isset __isset;

  void __set_success(const Result& val);

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

  bool operator < (const ProducerService_sendSync_result & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendSync_result& obj);
};

typedef struct _ProducerService_sendSync_presult__isset {
  _ProducerService_sendSync_presult__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendSync_presult__isset;

class ProducerService_sendSync_presult {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};


  virtual ~ProducerService_sendSync_presult() throw();
  Result* success;

  _ProducerService_sendSync_presult__isset __isset;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendSync_presult& obj);
};

typedef struct _ProducerService_sendBatchSync_args__isset {
  _ProducerService_sendBatchSync_args__isset() : messages(false) {}
  bool messages :1;
} _ProducerService_sendBatchSync_args__isset;

class ProducerService_sendBatchSync_args {
 public:

  static const char* ascii_fingerprint; // = "439B15B6142286A6E658F6ED04BA547E";
  static const uint8_t binary_fingerprint[16]; // = {0x43,0x9B,0x15,0xB6,0x14,0x22,0x86,0xA6,0xE6,0x58,0xF6,0xED,0x04,0xBA,0x54,0x7E};

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

  virtual ~ProducerService_sendBatchSync_args() throw();
  std::vector<Message>  messages;

  _ProducerService_sendBatchSync_args__isset __isset;

  void __set_messages(const std::vector<Message> & val);

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

  bool operator < (const ProducerService_sendBatchSync_args & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendBatchSync_args& obj);
};


class ProducerService_sendBatchSync_pargs {
 public:

  static const char* ascii_fingerprint; // = "439B15B6142286A6E658F6ED04BA547E";
  static const uint8_t binary_fingerprint[16]; // = {0x43,0x9B,0x15,0xB6,0x14,0x22,0x86,0xA6,0xE6,0x58,0xF6,0xED,0x04,0xBA,0x54,0x7E};


  virtual ~ProducerService_sendBatchSync_pargs() throw();
  const std::vector<Message> * messages;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendBatchSync_pargs& obj);
};

typedef struct _ProducerService_sendBatchSync_result__isset {
  _ProducerService_sendBatchSync_result__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendBatchSync_result__isset;

class ProducerService_sendBatchSync_result {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};

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

  virtual ~ProducerService_sendBatchSync_result() throw();
  Result success;

  _ProducerService_sendBatchSync_result__isset __isset;

  void __set_success(const Result& val);

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

  bool operator < (const ProducerService_sendBatchSync_result & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendBatchSync_result& obj);
};

typedef struct _ProducerService_sendBatchSync_presult__isset {
  _ProducerService_sendBatchSync_presult__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendBatchSync_presult__isset;

class ProducerService_sendBatchSync_presult {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};


  virtual ~ProducerService_sendBatchSync_presult() throw();
  Result* success;

  _ProducerService_sendBatchSync_presult__isset __isset;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendBatchSync_presult& obj);
};

typedef struct _ProducerService_sendAsync_args__isset {
  _ProducerService_sendAsync_args__isset() : message(false) {}
  bool message :1;
} _ProducerService_sendAsync_args__isset;

class ProducerService_sendAsync_args {
 public:

  static const char* ascii_fingerprint; // = "E91EF9A0924EA051F5C82275BFA00E82";
  static const uint8_t binary_fingerprint[16]; // = {0xE9,0x1E,0xF9,0xA0,0x92,0x4E,0xA0,0x51,0xF5,0xC8,0x22,0x75,0xBF,0xA0,0x0E,0x82};

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

  virtual ~ProducerService_sendAsync_args() throw();
  Message message;

  _ProducerService_sendAsync_args__isset __isset;

  void __set_message(const Message& val);

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

  bool operator < (const ProducerService_sendAsync_args & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendAsync_args& obj);
};


class ProducerService_sendAsync_pargs {
 public:

  static const char* ascii_fingerprint; // = "E91EF9A0924EA051F5C82275BFA00E82";
  static const uint8_t binary_fingerprint[16]; // = {0xE9,0x1E,0xF9,0xA0,0x92,0x4E,0xA0,0x51,0xF5,0xC8,0x22,0x75,0xBF,0xA0,0x0E,0x82};


  virtual ~ProducerService_sendAsync_pargs() throw();
  const Message* message;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendAsync_pargs& obj);
};

typedef struct _ProducerService_sendAsync_result__isset {
  _ProducerService_sendAsync_result__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendAsync_result__isset;

class ProducerService_sendAsync_result {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};

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

  virtual ~ProducerService_sendAsync_result() throw();
  Result success;

  _ProducerService_sendAsync_result__isset __isset;

  void __set_success(const Result& val);

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

  bool operator < (const ProducerService_sendAsync_result & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendAsync_result& obj);
};

typedef struct _ProducerService_sendAsync_presult__isset {
  _ProducerService_sendAsync_presult__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendAsync_presult__isset;

class ProducerService_sendAsync_presult {
 public:

  static const char* ascii_fingerprint; // = "7F71052749608759EEA52069A731855F";
  static const uint8_t binary_fingerprint[16]; // = {0x7F,0x71,0x05,0x27,0x49,0x60,0x87,0x59,0xEE,0xA5,0x20,0x69,0xA7,0x31,0x85,0x5F};


  virtual ~ProducerService_sendAsync_presult() throw();
  Result* success;

  _ProducerService_sendAsync_presult__isset __isset;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendAsync_presult& obj);
};

typedef struct _ProducerService_sendDelaySync_args__isset {
  _ProducerService_sendDelaySync_args__isset() : delayMessage(false), timeout(false) {}
  bool delayMessage :1;
  bool timeout :1;
} _ProducerService_sendDelaySync_args__isset;

class ProducerService_sendDelaySync_args {
 public:

  static const char* ascii_fingerprint; // = "593E5599C894680EA5C6AAF9BFC54186";
  static const uint8_t binary_fingerprint[16]; // = {0x59,0x3E,0x55,0x99,0xC8,0x94,0x68,0x0E,0xA5,0xC6,0xAA,0xF9,0xBF,0xC5,0x41,0x86};

  ProducerService_sendDelaySync_args(const ProducerService_sendDelaySync_args&);
  ProducerService_sendDelaySync_args& operator=(const ProducerService_sendDelaySync_args&);
  ProducerService_sendDelaySync_args() : timeout(0) {
  }

  virtual ~ProducerService_sendDelaySync_args() throw();
  DelayMessage delayMessage;
  int64_t timeout;

  _ProducerService_sendDelaySync_args__isset __isset;

  void __set_delayMessage(const DelayMessage& val);

  void __set_timeout(const int64_t val);

  bool operator == (const ProducerService_sendDelaySync_args & rhs) const
  {
    if (!(delayMessage == rhs.delayMessage))
      return false;
    if (!(timeout == rhs.timeout))
      return false;
    return true;
  }
  bool operator != (const ProducerService_sendDelaySync_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const ProducerService_sendDelaySync_args & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendDelaySync_args& obj);
};


class ProducerService_sendDelaySync_pargs {
 public:

  static const char* ascii_fingerprint; // = "593E5599C894680EA5C6AAF9BFC54186";
  static const uint8_t binary_fingerprint[16]; // = {0x59,0x3E,0x55,0x99,0xC8,0x94,0x68,0x0E,0xA5,0xC6,0xAA,0xF9,0xBF,0xC5,0x41,0x86};


  virtual ~ProducerService_sendDelaySync_pargs() throw();
  const DelayMessage* delayMessage;
  const int64_t* timeout;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendDelaySync_pargs& obj);
};

typedef struct _ProducerService_sendDelaySync_result__isset {
  _ProducerService_sendDelaySync_result__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendDelaySync_result__isset;

class ProducerService_sendDelaySync_result {
 public:

  static const char* ascii_fingerprint; // = "B736FD64F90FC6D1389FED1BF4E531E8";
  static const uint8_t binary_fingerprint[16]; // = {0xB7,0x36,0xFD,0x64,0xF9,0x0F,0xC6,0xD1,0x38,0x9F,0xED,0x1B,0xF4,0xE5,0x31,0xE8};

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

  virtual ~ProducerService_sendDelaySync_result() throw();
  DelayResult success;

  _ProducerService_sendDelaySync_result__isset __isset;

  void __set_success(const DelayResult& val);

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

  bool operator < (const ProducerService_sendDelaySync_result & ) const;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendDelaySync_result& obj);
};

typedef struct _ProducerService_sendDelaySync_presult__isset {
  _ProducerService_sendDelaySync_presult__isset() : success(false) {}
  bool success :1;
} _ProducerService_sendDelaySync_presult__isset;

class ProducerService_sendDelaySync_presult {
 public:

  static const char* ascii_fingerprint; // = "B736FD64F90FC6D1389FED1BF4E531E8";
  static const uint8_t binary_fingerprint[16]; // = {0xB7,0x36,0xFD,0x64,0xF9,0x0F,0xC6,0xD1,0x38,0x9F,0xED,0x1B,0xF4,0xE5,0x31,0xE8};


  virtual ~ProducerService_sendDelaySync_presult() throw();
  DelayResult* success;

  _ProducerService_sendDelaySync_presult__isset __isset;

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

  friend std::ostream& operator<<(std::ostream& out, const ProducerService_sendDelaySync_presult& obj);
};

class ProducerServiceClient : virtual public ProducerServiceIf {
 public:
  ProducerServiceClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  ProducerServiceClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void sendSync(Result& _return, const Message& message, const int64_t timeout);
  void send_sendSync(const Message& message, const int64_t timeout);
  void recv_sendSync(Result& _return);
  void sendBatchSync(Result& _return, const std::vector<Message> & messages);
  void send_sendBatchSync(const std::vector<Message> & messages);
  void recv_sendBatchSync(Result& _return);
  void sendAsync(Result& _return, const Message& message);
  void send_sendAsync(const Message& message);
  void recv_sendAsync(Result& _return);
  void sendDelaySync(DelayResult& _return, const DelayMessage& delayMessage, const int64_t timeout);
  void send_sendDelaySync(const DelayMessage& delayMessage, const int64_t timeout);
  void recv_sendDelaySync(DelayResult& _return);
 protected:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
};

class ProducerServiceProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  boost::shared_ptr<ProducerServiceIf> 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 (ProducerServiceProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_sendSync(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_sendBatchSync(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_sendAsync(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_sendDelaySync(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
 public:
  ProducerServiceProcessor(boost::shared_ptr<ProducerServiceIf> iface) :
    iface_(iface) {
    processMap_["sendSync"] = &ProducerServiceProcessor::process_sendSync;
    processMap_["sendBatchSync"] = &ProducerServiceProcessor::process_sendBatchSync;
    processMap_["sendAsync"] = &ProducerServiceProcessor::process_sendAsync;
    processMap_["sendDelaySync"] = &ProducerServiceProcessor::process_sendDelaySync;
  }

  virtual ~ProducerServiceProcessor() {}
};

class ProducerServiceProcessorFactory : public ::apache::thrift::TProcessorFactory {
 public:
  ProducerServiceProcessorFactory(const ::boost::shared_ptr< ProducerServiceIfFactory >& handlerFactory) :
      handlerFactory_(handlerFactory) {}

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

 protected:
  ::boost::shared_ptr< ProducerServiceIfFactory > handlerFactory_;
};

class ProducerServiceMultiface : virtual public ProducerServiceIf {
 public:
  ProducerServiceMultiface(std::vector<boost::shared_ptr<ProducerServiceIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~ProducerServiceMultiface() {}
 protected:
  std::vector<boost::shared_ptr<ProducerServiceIf> > ifaces_;
  ProducerServiceMultiface() {}
  void add(boost::shared_ptr<ProducerServiceIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  void sendSync(Result& _return, const Message& message, const int64_t timeout) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->sendSync(_return, message, timeout);
    }
    ifaces_[i]->sendSync(_return, message, timeout);
    return;
  }

  void sendBatchSync(Result& _return, const std::vector<Message> & messages) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->sendBatchSync(_return, messages);
    }
    ifaces_[i]->sendBatchSync(_return, messages);
    return;
  }

  void sendAsync(Result& _return, const Message& message) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->sendAsync(_return, message);
    }
    ifaces_[i]->sendAsync(_return, message);
    return;
  }

  void sendDelaySync(DelayResult& _return, const DelayMessage& delayMessage, const int64_t timeout) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->sendDelaySync(_return, delayMessage, timeout);
    }
    ifaces_[i]->sendDelaySync(_return, delayMessage, timeout);
    return;
  }

};

} // namespace

#endif
