Nektar++
RawType.hpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: RawType.hpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Template metafunction which removes pointers, const, and
33 // volatile modifiers to a type.
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIB_UTILITIES_BASICUTILS_RAW_TYPE_HPP
38 #define NEKTAR_LIB_UTILITIES_BASICUTILS_RAW_TYPE_HPP
39 
40 #include <boost/shared_ptr.hpp>
41 
42 namespace Nektar
43 {
44  template<typename T>
45  struct RawType { typedef T type; };
46 
47  template<typename T>
48  struct RawType<const T> { typedef T type; };
49 
50  template<typename T>
51  struct RawType<volatile T> { typedef T type; };
52 
53  template<typename T>
54  struct RawType<const volatile T> { typedef T type; };
55 
56  template<typename T>
57  struct RawType<T*> { typedef T type; };
58 
59  template<typename T>
60  struct RawType<const T*> { typedef T type; };
61 
62  template<typename T>
63  struct RawType<volatile T*> { typedef T type; };
64 
65  template<typename T>
66  struct RawType<const volatile T*> { typedef T type; };
67 
68  template<typename T>
69  struct RawType<T* const> { typedef T type; };
70 
71  template<typename T>
72  struct RawType<const T* const> { typedef T type; };
73 
74  template<typename T>
75  struct RawType<volatile T* const> { typedef T type; };
76 
77  template<typename T>
78  struct RawType<const volatile T* const> { typedef T type; };
79 
80  template<typename T>
81  struct RawType<T* volatile> { typedef T type; };
82 
83  template<typename T>
84  struct RawType<const T* volatile> { typedef T type; };
85 
86  template<typename T>
87  struct RawType<volatile T* volatile> { typedef T type; };
88 
89  template<typename T>
90  struct RawType<const volatile T* volatile> { typedef T type; };
91 
92  template<typename T>
93  struct RawType<T* const volatile> { typedef T type; };
94 
95  template<typename T>
96  struct RawType<const T* const volatile> { typedef T type; };
97 
98  template<typename T>
99  struct RawType<volatile T* const volatile> { typedef T type; };
100 
101  template<typename T>
102  struct RawType<const volatile T* const volatile> { typedef T type; };
103 
104  template<typename T>
105  struct RawType<boost::shared_ptr<T> > { typedef T type; };
106 
107  template<typename T>
108  struct RawType<const boost::shared_ptr<T> > { typedef T type; };
109 
110  template<typename T>
111  struct RawType<volatile boost::shared_ptr<T> > { typedef T type; };
112 
113  template<typename T>
114  struct RawType<const volatile boost::shared_ptr<T> > { typedef T type; };
115 
116 
117  template<typename T>
118  struct RawType<boost::shared_ptr<const T> > { typedef T type; };
119 
120  template<typename T>
121  struct RawType<const boost::shared_ptr<const T> > { typedef T type; };
122 
123  template<typename T>
124  struct RawType<volatile boost::shared_ptr<const T> > { typedef T type; };
125 
126  template<typename T>
127  struct RawType<const volatile boost::shared_ptr<const T> > { typedef T type; };
128 
129 
130 
131  template<typename T>
132  struct RawType<boost::shared_ptr<volatile T> > { typedef T type; };
133 
134  template<typename T>
135  struct RawType<const boost::shared_ptr<volatile T> > { typedef T type; };
136 
137  template<typename T>
138  struct RawType<volatile boost::shared_ptr<volatile T> > { typedef T type; };
139 
140  template<typename T>
141  struct RawType<const volatile boost::shared_ptr<volatile T> > { typedef T type; };
142 
143 
144  template<typename T>
145  struct RawType<boost::shared_ptr<const volatile T> > { typedef T type; };
146 
147  template<typename T>
148  struct RawType<const boost::shared_ptr<const volatile T> > { typedef T type; };
149 
150  template<typename T>
151  struct RawType<volatile boost::shared_ptr<const volatile T> > { typedef T type; };
152 
153  template<typename T>
154  struct RawType<const volatile boost::shared_ptr<const volatile T> > { typedef T type; };
155 
156 }
157 
158 #endif //NEKTAR_LIB_UTILITIES_BASICUTILS_RAW_TYPE_HPP