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
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
     2 
     3 #ifndef TYPE_NAME_H
     4 #define TYPE_NAME_H
     5 
     6 #include <stdint.h>
     7 #include <string>
     8 
     9 namespace ns3 {
    10 
    11 template <typename T>
    12 std::string TypeNameGet (void)
    13 {
    14   return "unknown";
    15 }
    16 
    17 #define DEF_TYPE(x)				\
    18   template <>					\
    19     std::string TypeNameGet<x> (void)
    20   
    21 DEF_TYPE (uint8_t);
    22 DEF_TYPE (uint16_t);
    23 DEF_TYPE (uint32_t);
    24 DEF_TYPE (uint64_t);
    25 DEF_TYPE (int8_t);
    26 DEF_TYPE (int16_t);
    27 DEF_TYPE (int32_t);
    28 DEF_TYPE (int64_t);
    29 DEF_TYPE (float);
    30 DEF_TYPE (double);
    31 
    32 #undef DEF_TYPE
    33 
    34 }//namespace ns3
    35 
    36 #endif /* TYPE_NAME_H */