#ifndef SERVICE_CONVERSION_H
#define SERVICE_CONVERSION_H

#include "service.h"

namespace hierarchy_memory
{
  namespace sim2os
  {
    namespace service
    {
    
      int service2int(service_t num_service)
      {
	return (int)num_service;
      }

      service_t int2service (int val)
      {
	switch (val)
	  {
	  case SERVICE_OPEN          : return SERVICE_OPEN ;
	  case SERVICE_CLOSE         : return SERVICE_CLOSE;
	  case SERVICE_READ          : return SERVICE_READ ;
	  case SERVICE_WRITE         : return SERVICE_WRITE;
	  case SERVICE_TIME          : return SERVICE_TIME ;
	  case SERVICE_CLOCK         : return SERVICE_CLOCK;
	  case SERVICE_LSEEK         : return SERVICE_LSEEK;
	  case SERVICE_UNIMPLEMENTED : return SERVICE_UNIMPLEMENTED;
	  default                    : return SERVICE_UNDEFINED;
	  }//end switch
      }

    };};};
#endif //SERVICE_CONVERSION_H
