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

#include "SimpleSwitch.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;

using boost::shared_ptr;

using namespace  ::sswitch_runtime;

class SimpleSwitchHandler : virtual public SimpleSwitchIf {
 public:
  SimpleSwitchHandler() {
    // Your initialization goes here
  }

  int32_t mirroring_mapping_add(const int32_t mirror_id, const int32_t egress_port) {
    // Your implementation goes here
    printf("mirroring_mapping_add\n");
  }

  int32_t mirroring_mapping_delete(const int32_t mirror_id) {
    // Your implementation goes here
    printf("mirroring_mapping_delete\n");
  }

  int32_t mirroring_mapping_get_egress_port(const int32_t mirror_id) {
    // Your implementation goes here
    printf("mirroring_mapping_get_egress_port\n");
  }

  int32_t set_egress_queue_depth(const int32_t port_num, const int32_t depth_pkts) {
    // Your implementation goes here
    printf("set_egress_queue_depth\n");
  }

  int32_t set_all_egress_queue_depths(const int32_t depth_pkts) {
    // Your implementation goes here
    printf("set_all_egress_queue_depths\n");
  }

  int32_t set_egress_queue_rate(const int32_t port_num, const int64_t rate_pps) {
    // Your implementation goes here
    printf("set_egress_queue_rate\n");
  }

  int32_t set_all_egress_queue_rates(const int64_t rate_pps) {
    // Your implementation goes here
    printf("set_all_egress_queue_rates\n");
  }

  int64_t get_time_elapsed_us() {
    // Your implementation goes here
    printf("get_time_elapsed_us\n");
  }

  int64_t get_time_since_epoch_us() {
    // Your implementation goes here
    printf("get_time_since_epoch_us\n");
  }

};

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

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

