echelon  0.8.0
type_traits.hpp
1 // Copyright (c) 2012-2014 Christopher Hinz
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef ECHELON_HDF5_TYPE_TRAITS_HPP
7 #define ECHELON_HDF5_TYPE_TRAITS_HPP
8 
9 #include <echelon/hdf5/precursor/object_reference.hpp>
10 
11 #include <boost/mpl/bool.hpp>
12 
13 #include <string>
14 
15 namespace echelon
16 {
17 namespace hdf5
18 {
19 template <typename T>
20 struct is_predefined_hdf5_type : boost::mpl::false_
21 {
22 };
23 
24 template <>
25 struct is_predefined_hdf5_type<char> : boost::mpl::true_
26 {
27 };
28 
29 template <>
30 struct is_predefined_hdf5_type<unsigned char> : boost::mpl::true_
31 {
32 };
33 
34 template <>
35 struct is_predefined_hdf5_type<short> : boost::mpl::true_
36 {
37 };
38 
39 template <>
40 struct is_predefined_hdf5_type<unsigned short> : boost::mpl::true_
41 {
42 };
43 
44 template <>
45 struct is_predefined_hdf5_type<int> : boost::mpl::true_
46 {
47 };
48 
49 template <>
50 struct is_predefined_hdf5_type<unsigned int> : boost::mpl::true_
51 {
52 };
53 
54 template <>
55 struct is_predefined_hdf5_type<long> : boost::mpl::true_
56 {
57 };
58 
59 template <>
60 struct is_predefined_hdf5_type<unsigned long> : boost::mpl::true_
61 {
62 };
63 
64 template <>
65 struct is_predefined_hdf5_type<long long> : boost::mpl::true_
66 {
67 };
68 
69 template <>
70 struct is_predefined_hdf5_type<unsigned long long> : boost::mpl::true_
71 {
72 };
73 
74 template <>
75 struct is_predefined_hdf5_type<float> : boost::mpl::true_
76 {
77 };
78 
79 template <>
80 struct is_predefined_hdf5_type<double> : boost::mpl::true_
81 {
82 };
83 
84 template <>
85 struct is_predefined_hdf5_type<bool> : boost::mpl::true_
86 {
87 };
88 
89 template <>
90 struct is_predefined_hdf5_type<std::string> : boost::mpl::true_
91 {
92 };
93 
94 template <std::size_t N>
95 struct is_predefined_hdf5_type<char[N]> : boost::mpl::true_
96 {
97 };
98 
99 template<>
100 struct is_predefined_hdf5_type<char*> : boost::mpl::true_
101 {
102 };
103 
104 template<>
105 struct is_predefined_hdf5_type<const char*> : boost::mpl::true_
106 {
107 };
108 
109 template <>
110 struct is_predefined_hdf5_type<precursor::object_reference> : boost::mpl::true_
111 {
112 };
113 
114 template <typename T>
115 struct is_predefined_hdf5_type<T const> : is_predefined_hdf5_type<typename std::remove_cv<T>::type>
116 {
117 };
118 
119 template <typename T>
120 struct is_hdf5_type : is_predefined_hdf5_type<T>
121 {
122 };
123 
124 template <typename T>
125 struct is_hdf5_type<T const> : is_hdf5_type<typename std::remove_cv<T>::type>
126 {
127 };
128 }
129 }
130 
131 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10