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

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



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

class UsersIf {
 public:
  virtual ~UsersIf() {}
  virtual void createUser(const std::string& username, const std::string& password, const UserProfile& profile) = 0;
  virtual void updateProfile(const std::string& username, const UserProfile& profile) = 0;
  virtual void updatePassword(const std::string& username, const std::string& newPassword) = 0;
  virtual void deleteUser(const std::string& username) = 0;
};

class UsersIfFactory {
 public:
  typedef UsersIf Handler;

  virtual ~UsersIfFactory() {}

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

class UsersIfSingletonFactory : virtual public UsersIfFactory {
 public:
  UsersIfSingletonFactory(const ::std::shared_ptr<UsersIf>& iface) : iface_(iface) {}
  virtual ~UsersIfSingletonFactory() {}

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

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

class UsersNull : virtual public UsersIf {
 public:
  virtual ~UsersNull() {}
  void createUser(const std::string& /* username */, const std::string& /* password */, const UserProfile& /* profile */) {
    return;
  }
  void updateProfile(const std::string& /* username */, const UserProfile& /* profile */) {
    return;
  }
  void updatePassword(const std::string& /* username */, const std::string& /* newPassword */) {
    return;
  }
  void deleteUser(const std::string& /* username */) {
    return;
  }
};


class Users_createUser_args {
 public:

  Users_createUser_args(const Users_createUser_args&);
  Users_createUser_args& operator=(const Users_createUser_args&);
  Users_createUser_args() : username(), password() {
  }

  virtual ~Users_createUser_args() noexcept;
  std::string username;
  std::string password;
  UserProfile profile;

  void __set_username(const std::string& val);

  void __set_password(const std::string& val);

  void __set_profile(const UserProfile& val);

  bool operator == (const Users_createUser_args & rhs) const
  {
    if (!(username == rhs.username))
      return false;
    if (!(password == rhs.password))
      return false;
    if (!(profile == rhs.profile))
      return false;
    return true;
  }
  bool operator != (const Users_createUser_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const Users_createUser_args & ) const;

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

};


class Users_createUser_pargs {
 public:


  virtual ~Users_createUser_pargs() noexcept;
  const std::string* username;
  const std::string* password;
  const UserProfile* profile;

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

};

typedef struct _Users_createUser_result__isset {
  _Users_createUser_result__isset() : err1(false) {}
  bool err1 :1;
} _Users_createUser_result__isset;

class Users_createUser_result {
 public:

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

  virtual ~Users_createUser_result() noexcept;
  UserExists err1;

  _Users_createUser_result__isset __isset;

  void __set_err1(const UserExists& val);

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

  bool operator < (const Users_createUser_result & ) const;

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

};

typedef struct _Users_createUser_presult__isset {
  _Users_createUser_presult__isset() : err1(false) {}
  bool err1 :1;
} _Users_createUser_presult__isset;

class Users_createUser_presult {
 public:


  virtual ~Users_createUser_presult() noexcept;
  UserExists err1;

  _Users_createUser_presult__isset __isset;

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

};


class Users_updateProfile_args {
 public:

  Users_updateProfile_args(const Users_updateProfile_args&);
  Users_updateProfile_args& operator=(const Users_updateProfile_args&);
  Users_updateProfile_args() : username() {
  }

  virtual ~Users_updateProfile_args() noexcept;
  std::string username;
  UserProfile profile;

  void __set_username(const std::string& val);

  void __set_profile(const UserProfile& val);

  bool operator == (const Users_updateProfile_args & rhs) const
  {
    if (!(username == rhs.username))
      return false;
    if (!(profile == rhs.profile))
      return false;
    return true;
  }
  bool operator != (const Users_updateProfile_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const Users_updateProfile_args & ) const;

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

};


class Users_updateProfile_pargs {
 public:


  virtual ~Users_updateProfile_pargs() noexcept;
  const std::string* username;
  const UserProfile* profile;

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

};

typedef struct _Users_updateProfile_result__isset {
  _Users_updateProfile_result__isset() : err1(false) {}
  bool err1 :1;
} _Users_updateProfile_result__isset;

class Users_updateProfile_result {
 public:

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

  virtual ~Users_updateProfile_result() noexcept;
  UserNotFound err1;

  _Users_updateProfile_result__isset __isset;

  void __set_err1(const UserNotFound& val);

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

  bool operator < (const Users_updateProfile_result & ) const;

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

};

typedef struct _Users_updateProfile_presult__isset {
  _Users_updateProfile_presult__isset() : err1(false) {}
  bool err1 :1;
} _Users_updateProfile_presult__isset;

class Users_updateProfile_presult {
 public:


  virtual ~Users_updateProfile_presult() noexcept;
  UserNotFound err1;

  _Users_updateProfile_presult__isset __isset;

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

};


class Users_updatePassword_args {
 public:

  Users_updatePassword_args(const Users_updatePassword_args&);
  Users_updatePassword_args& operator=(const Users_updatePassword_args&);
  Users_updatePassword_args() : username(), newPassword() {
  }

  virtual ~Users_updatePassword_args() noexcept;
  std::string username;
  std::string newPassword;

  void __set_username(const std::string& val);

  void __set_newPassword(const std::string& val);

  bool operator == (const Users_updatePassword_args & rhs) const
  {
    if (!(username == rhs.username))
      return false;
    if (!(newPassword == rhs.newPassword))
      return false;
    return true;
  }
  bool operator != (const Users_updatePassword_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const Users_updatePassword_args & ) const;

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

};


class Users_updatePassword_pargs {
 public:


  virtual ~Users_updatePassword_pargs() noexcept;
  const std::string* username;
  const std::string* newPassword;

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

};

typedef struct _Users_updatePassword_result__isset {
  _Users_updatePassword_result__isset() : err1(false) {}
  bool err1 :1;
} _Users_updatePassword_result__isset;

class Users_updatePassword_result {
 public:

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

  virtual ~Users_updatePassword_result() noexcept;
  UserNotFound err1;

  _Users_updatePassword_result__isset __isset;

  void __set_err1(const UserNotFound& val);

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

  bool operator < (const Users_updatePassword_result & ) const;

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

};

typedef struct _Users_updatePassword_presult__isset {
  _Users_updatePassword_presult__isset() : err1(false) {}
  bool err1 :1;
} _Users_updatePassword_presult__isset;

class Users_updatePassword_presult {
 public:


  virtual ~Users_updatePassword_presult() noexcept;
  UserNotFound err1;

  _Users_updatePassword_presult__isset __isset;

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

};


class Users_deleteUser_args {
 public:

  Users_deleteUser_args(const Users_deleteUser_args&);
  Users_deleteUser_args& operator=(const Users_deleteUser_args&);
  Users_deleteUser_args() : username() {
  }

  virtual ~Users_deleteUser_args() noexcept;
  std::string username;

  void __set_username(const std::string& val);

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

  bool operator < (const Users_deleteUser_args & ) const;

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

};


class Users_deleteUser_pargs {
 public:


  virtual ~Users_deleteUser_pargs() noexcept;
  const std::string* username;

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

};

typedef struct _Users_deleteUser_result__isset {
  _Users_deleteUser_result__isset() : err1(false) {}
  bool err1 :1;
} _Users_deleteUser_result__isset;

class Users_deleteUser_result {
 public:

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

  virtual ~Users_deleteUser_result() noexcept;
  UserNotFound err1;

  _Users_deleteUser_result__isset __isset;

  void __set_err1(const UserNotFound& val);

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

  bool operator < (const Users_deleteUser_result & ) const;

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

};

typedef struct _Users_deleteUser_presult__isset {
  _Users_deleteUser_presult__isset() : err1(false) {}
  bool err1 :1;
} _Users_deleteUser_presult__isset;

class Users_deleteUser_presult {
 public:


  virtual ~Users_deleteUser_presult() noexcept;
  UserNotFound err1;

  _Users_deleteUser_presult__isset __isset;

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

};

class UsersClient : virtual public UsersIf {
 public:
  UsersClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  UsersClient(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 createUser(const std::string& username, const std::string& password, const UserProfile& profile);
  void send_createUser(const std::string& username, const std::string& password, const UserProfile& profile);
  void recv_createUser();
  void updateProfile(const std::string& username, const UserProfile& profile);
  void send_updateProfile(const std::string& username, const UserProfile& profile);
  void recv_updateProfile();
  void updatePassword(const std::string& username, const std::string& newPassword);
  void send_updatePassword(const std::string& username, const std::string& newPassword);
  void recv_updatePassword();
  void deleteUser(const std::string& username);
  void send_deleteUser(const std::string& username);
  void recv_deleteUser();
 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 UsersProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  ::std::shared_ptr<UsersIf> 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 (UsersProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_createUser(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_updateProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_updatePassword(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
  void process_deleteUser(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
 public:
  UsersProcessor(::std::shared_ptr<UsersIf> iface) :
    iface_(iface) {
    processMap_["createUser"] = &UsersProcessor::process_createUser;
    processMap_["updateProfile"] = &UsersProcessor::process_updateProfile;
    processMap_["updatePassword"] = &UsersProcessor::process_updatePassword;
    processMap_["deleteUser"] = &UsersProcessor::process_deleteUser;
  }

  virtual ~UsersProcessor() {}
};

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

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

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

class UsersMultiface : virtual public UsersIf {
 public:
  UsersMultiface(std::vector<std::shared_ptr<UsersIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~UsersMultiface() {}
 protected:
  std::vector<std::shared_ptr<UsersIf> > ifaces_;
  UsersMultiface() {}
  void add(::std::shared_ptr<UsersIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  void createUser(const std::string& username, const std::string& password, const UserProfile& profile) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->createUser(username, password, profile);
    }
    ifaces_[i]->createUser(username, password, profile);
  }

  void updateProfile(const std::string& username, const UserProfile& profile) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->updateProfile(username, profile);
    }
    ifaces_[i]->updateProfile(username, profile);
  }

  void updatePassword(const std::string& username, const std::string& newPassword) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->updatePassword(username, newPassword);
    }
    ifaces_[i]->updatePassword(username, newPassword);
  }

  void deleteUser(const std::string& username) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->deleteUser(username);
    }
    ifaces_[i]->deleteUser(username);
  }

};

// 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 UsersConcurrentClient : virtual public UsersIf {
 public:
  UsersConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot, std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync)
{
    setProtocol(prot);
  }
  UsersConcurrentClient(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 createUser(const std::string& username, const std::string& password, const UserProfile& profile);
  int32_t send_createUser(const std::string& username, const std::string& password, const UserProfile& profile);
  void recv_createUser(const int32_t seqid);
  void updateProfile(const std::string& username, const UserProfile& profile);
  int32_t send_updateProfile(const std::string& username, const UserProfile& profile);
  void recv_updateProfile(const int32_t seqid);
  void updatePassword(const std::string& username, const std::string& newPassword);
  int32_t send_updatePassword(const std::string& username, const std::string& newPassword);
  void recv_updatePassword(const int32_t seqid);
  void deleteUser(const std::string& username);
  int32_t send_deleteUser(const std::string& username);
  void recv_deleteUser(const int32_t seqid);
 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



#endif
