TypeName.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint> // TODO
4#include <string>
5#include <typeinfo>
6
7namespace armarx::aron
8{
9 // default implementation
10 template <typename T>
11 struct TypeName
12 {
13 static const char*
15 {
16 return typeid(T).name();
17 }
18 };
19
20 template <>
21 struct TypeName<unsigned char>
22 {
23 static const char*
25 {
26 return "unsigned char";
27 }
28 };
29
30 template <>
31 struct TypeName<unsigned short>
32 {
33 static const char*
35 {
36 return "unsigned short";
37 }
38 };
39
40 template <>
41 struct TypeName<unsigned int>
42 {
43 static const char*
45 {
46 return "unsigned int";
47 }
48 };
49
50 template <>
51 struct TypeName<short>
52 {
53 static const char*
55 {
56 return "short";
57 }
58 };
59
60 template <>
61 struct TypeName<int>
62 {
63 static const char*
65 {
66 return "int";
67 }
68 };
69
70 template <>
72 {
73 static const char*
75 {
76 return "float";
77 }
78 };
79
80 template <>
81 struct TypeName<long>
82 {
83 static const char*
85 {
86 return "long";
87 }
88 };
89
90 template <>
91 struct TypeName<double>
92 {
93 static const char*
95 {
96 return "double";
97 }
98 };
99
100 template <>
101 struct TypeName<std::string>
102 {
103 static const char*
105 {
106 return "string";
107 }
108 };
109
110 template <>
111 struct TypeName<bool>
112 {
113 static const char*
115 {
116 return "bool";
117 }
118 };
119} // namespace armarx::aron
#define float
Definition 16_Level.h:22
static const char * Get()
Definition TypeName.h:114
static const char * Get()
Definition TypeName.h:94
static const char * Get()
Definition TypeName.h:74
static const char * Get()
Definition TypeName.h:64
static const char * Get()
Definition TypeName.h:84
static const char * Get()
Definition TypeName.h:54
static const char * Get()
Definition TypeName.h:14