// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.

#include "Users.h"
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>

using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;

class UsersHandler : virtual public UsersIf {
 public:
  UsersHandler() {
    // Your initialization goes here
  }

  void createUser(const std::string& username, const std::string& password, const UserProfile& profile) {
    // Your implementation goes here
    printf("createUser\n");
  }

  void updateProfile(const std::string& username, const UserProfile& profile) {
    // Your implementation goes here
    printf("updateProfile\n");
  }

  void updatePassword(const std::string& username, const std::string& newPassword) {
    // Your implementation goes here
    printf("updatePassword\n");
  }

  void deleteUser(const std::string& username) {
    // Your implementation goes here
    printf("deleteUser\n");
  }

};

int main(int argc, char **argv) {
  int port = 9090;
  ::std::shared_ptr<UsersHandler> handler(new UsersHandler());
  ::std::shared_ptr<TProcessor> processor(new UsersProcessor(handler));
  ::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
  ::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
  ::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());

  TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
  server.serve();
  return 0;
}

