A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
type-name.h
Go to the documentation of this file.
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 */
DEF_TYPE(uint8_t)
std::string TypeNameGet(void)
Definition: type-name.h:12