src/core/type-name.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 04 Jul 2009 08:15:48 +0200
changeset 4654 2eaebe77d66b
parent 439 fed13fb45eef
permissions -rw-r--r--
Added tag ns-3.5 for changeset c975274c9707
raj@439
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
raj@439
     2
raj@439
     3
#ifndef TYPE_NAME_H
raj@439
     4
#define TYPE_NAME_H
raj@439
     5
raj@439
     6
#include <stdint.h>
raj@439
     7
#include <string>
raj@439
     8
raj@439
     9
namespace ns3 {
raj@439
    10
raj@439
    11
template <typename T>
raj@439
    12
std::string TypeNameGet (void)
raj@439
    13
{
raj@439
    14
  return "unknown";
raj@439
    15
}
raj@439
    16
raj@439
    17
#define DEF_TYPE(x)				\
raj@439
    18
  template <>					\
raj@439
    19
    std::string TypeNameGet<x> (void)
raj@439
    20
  
raj@439
    21
DEF_TYPE (uint8_t);
raj@439
    22
DEF_TYPE (uint16_t);
raj@439
    23
DEF_TYPE (uint32_t);
raj@439
    24
DEF_TYPE (uint64_t);
raj@439
    25
DEF_TYPE (int8_t);
raj@439
    26
DEF_TYPE (int16_t);
raj@439
    27
DEF_TYPE (int32_t);
raj@439
    28
DEF_TYPE (int64_t);
mathieu@959
    29
DEF_TYPE (float);
mathieu@959
    30
DEF_TYPE (double);
raj@439
    31
raj@439
    32
#undef DEF_TYPE
raj@439
    33
raj@439
    34
}//namespace ns3
raj@439
    35
raj@439
    36
#endif /* TYPE_NAME_H */