source: XIOS/trunk/src/type/type_util.hpp @ 327

Last change on this file since 327 was 327, checked in by ymipsl, 12 years ago

port to gfortran/g++

YM

File size: 1.4 KB
Line 
1#ifndef __TYPE_UTIL_HPP__
2#define __TYPE_UTIL_HPP__
3
4#include <string>
5namespace xmlioserver
6{
7  namespace tree
8  {
9    class CDomain ;
10    class CDomainGroup;
11    class CField;
12    class CFieldGroup;
13    class CGrid;
14    class CGridGroup;
15    class CAxis;
16    class CAxisGroup;
17    class CFile;
18    class CFileGroup;
19    class CContext;
20  }
21
22/*
23  typedef tree::CDomain CDomain;
24  typedef tree::CDomainGroup CDomainGroup;
25  typedef tree::CField CField;
26  typedef tree::CFieldGroup CFieldGroup;
27  typedef tree::CGrid CGrid;
28  typedef tree::CGridGroup CGridGroup;
29  typedef tree::CAxis CAxis;
30  typedef tree::CAxisGroup CAxisGroup;
31  typedef tree::CFile CFile;
32  typedef tree::CFileGroup CFileGroup;
33  typedef tree::CContext CContext;
34*/
35       
36  template <typename T>
37  inline string getStrType(void) ;
38   
39#define macro(T) template <> inline string getStrType<T>(void) { return std::string(#T) ; }
40
41  macro(short)
42  macro(unsigned short)
43  macro(int)
44  macro(unsigned int)
45  macro(long)
46  macro(unsigned long)
47  macro(float)
48  macro(double)
49  macro(long double)
50  macro(char)
51  macro(unsigned char)
52  macro(wchar_t)
53  macro(bool)
54#undef macro
55 
56#define macro(T) template <> inline string getStrType<tree::T>(void) { return std::string(#T) ; }
57  macro(CDomain)
58  macro(CDomainGroup)
59  macro(CField)
60  macro(CFieldGroup)
61  macro(CGrid)
62  macro(CGridGroup)
63  macro(CAxis)
64  macro(CAxisGroup)
65  macro(CFile)
66  macro(CFileGroup)
67  macro(CContext)
68 
69#undef macro
70
71}
72
73
74#endif
Note: See TracBrowser for help on using the repository browser.