Rev | Line | |
---|
[313] | 1 | #ifndef __TYPE_UTIL_HPP__ |
---|
| 2 | #define __TYPE_UTIL_HPP__ |
---|
| 3 | |
---|
| 4 | #include <string> |
---|
[335] | 5 | namespace xios |
---|
[313] | 6 | { |
---|
| 7 | class CDomain ; |
---|
| 8 | class CDomainGroup; |
---|
| 9 | class CField; |
---|
| 10 | class CFieldGroup; |
---|
| 11 | class CGrid; |
---|
| 12 | class CGridGroup; |
---|
| 13 | class CAxis; |
---|
| 14 | class CAxisGroup; |
---|
| 15 | class CFile; |
---|
| 16 | class CFileGroup; |
---|
| 17 | class CContext; |
---|
[352] | 18 | class CContextGroup; |
---|
| 19 | class CVariable ; |
---|
| 20 | class CVariableGroup ; |
---|
[313] | 21 | |
---|
[352] | 22 | template <typename T> inline string getStrType(void) ; |
---|
[313] | 23 | |
---|
| 24 | #define macro(T) template <> inline string getStrType<T>(void) { return std::string(#T) ; } |
---|
| 25 | |
---|
| 26 | macro(short) |
---|
| 27 | macro(unsigned short) |
---|
| 28 | macro(int) |
---|
| 29 | macro(unsigned int) |
---|
| 30 | macro(long) |
---|
| 31 | macro(unsigned long) |
---|
| 32 | macro(float) |
---|
| 33 | macro(double) |
---|
| 34 | macro(long double) |
---|
| 35 | macro(char) |
---|
| 36 | macro(unsigned char) |
---|
| 37 | macro(wchar_t) |
---|
| 38 | macro(bool) |
---|
[327] | 39 | #undef macro |
---|
| 40 | |
---|
[345] | 41 | #define macro(T) template <> inline string getStrType<T>(void) { return std::string(#T) ; } |
---|
[313] | 42 | macro(CDomain) |
---|
| 43 | macro(CDomainGroup) |
---|
| 44 | macro(CField) |
---|
| 45 | macro(CFieldGroup) |
---|
| 46 | macro(CGrid) |
---|
| 47 | macro(CGridGroup) |
---|
| 48 | macro(CAxis) |
---|
| 49 | macro(CAxisGroup) |
---|
| 50 | macro(CFile) |
---|
| 51 | macro(CFileGroup) |
---|
| 52 | macro(CContext) |
---|
[352] | 53 | macro(CContextGroup) |
---|
| 54 | macro(CVariable) |
---|
| 55 | macro(CVariableGroup) |
---|
[313] | 56 | |
---|
[352] | 57 | |
---|
[313] | 58 | #undef macro |
---|
| 59 | |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.