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

#include "TestService.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 TestServiceHandler : virtual public TestServiceIf {
 public:
  TestServiceHandler() {
    // Your initialization goes here
  }

  void echoTree(RecTree& _return, const RecTree& tree) {
    // Your implementation goes here
    printf("echoTree\n");
  }

  void echoList(RecList& _return, const RecList& lst) {
    // Your implementation goes here
    printf("echoList\n");
  }

  void echoCoRec(CoRec& _return, const CoRec& item) {
    // Your implementation goes here
    printf("echoCoRec\n");
  }

};

int main(int argc, char **argv) {
  int port = 9090;
  ::std::shared_ptr<TestServiceHandler> handler(new TestServiceHandler());
  ::std::shared_ptr<TProcessor> processor(new TestServiceProcessor(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;
}

