00001 #ifndef __INSTANTIO_TYPENAME_H
00002 #define __INSTANTIO_TYPENAME_H
00003
00004 #ifdef _MSC_VER
00005 # pragma once
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "InstantIODef.h"
00027 #include <string>
00028 #include <typeinfo>
00029
00030
00031 namespace InstantIO
00032 {
00033
00034
00043 template <class T> class INSTANTIO_DLLMAPPING TypeName
00044 {
00045 public:
00046
00051 static const char *getName()
00052 { return typeid(T).name(); };
00053
00054 private:
00055
00057 TypeName();
00058
00060 TypeName(const TypeName &);
00061
00063 const TypeName &operator=(const TypeName &);
00064 };
00065
00066
00073 template <>
00074 class INSTANTIO_DLLMAPPING TypeName<bool>
00075 {
00076 public:
00077
00082 static const char *getName();
00083
00084 private:
00085
00087 TypeName();
00088
00090 TypeName(const TypeName &);
00091
00093 const TypeName &operator=(const TypeName &);
00094 };
00095
00096
00103 template <>
00104 class INSTANTIO_DLLMAPPING TypeName<double>
00105 {
00106 public:
00107
00112 static const char *getName();
00113
00114 private:
00115
00117 TypeName();
00118
00120 TypeName(const TypeName &);
00121
00123 const TypeName &operator=(const TypeName &);
00124 };
00125
00126
00133 template <>
00134 class INSTANTIO_DLLMAPPING TypeName<float>
00135 {
00136 public:
00137
00142 static const char *getName();
00143
00144 private:
00145
00147 TypeName();
00148
00150 TypeName(const TypeName &);
00151
00153 const TypeName &operator=(const TypeName &);
00154 };
00155
00156
00163 template <>
00164 class INSTANTIO_DLLMAPPING TypeName<long>
00165 {
00166 public:
00167
00172 static const char *getName();
00173
00174 private:
00175
00177 TypeName();
00178
00180 TypeName(const TypeName &);
00181
00183 const TypeName &operator=(const TypeName &);
00184 };
00185
00186
00193 template <>
00194 class INSTANTIO_DLLMAPPING TypeName<std::string>
00195 {
00196 public:
00197
00202 static const char *getName();
00203
00204 private:
00205
00207 TypeName();
00208
00210 TypeName(const TypeName &);
00211
00213 const TypeName &operator=(const TypeName &);
00214 };
00215
00216
00217 }
00218
00219
00220 #endif // __INSTANTIO_TYPENAME_H