SheafSystem
0.0.0.0
primitive_traits.cc
1
2
//
3
// Copyright (c) 2014 Limit Point Systems, Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
18
// Implementation for class template primitive_traits.
19
20
#include "SheafSystem/primitive_traits.h"
21
#include "SheafSystem/error_message.h"
22
#include "SheafSystem/std_hdf5.h"
23
24
// Definitions of primitive_traits::hdf_type given here to encapsulate hdf.
28
29
int
sheaf::primitive_traits<bool>::hdf_type
()
30
{
31
return
H5T_NATIVE_B8;
32
}
33
34
int
sheaf::primitive_traits<char>::hdf_type
()
35
{
36
return
H5T_NATIVE_CHAR;
37
}
38
39
int
sheaf::primitive_traits<signed char>::hdf_type
()
40
{
41
return
H5T_NATIVE_SCHAR;
42
}
43
44
int
sheaf::primitive_traits<short int>::hdf_type
()
45
{
46
return
H5T_NATIVE_SHORT;
47
}
48
49
int
sheaf::primitive_traits<int>::hdf_type
()
50
{
51
return
H5T_NATIVE_INT;
52
}
53
54
int
sheaf::primitive_traits<long int>::hdf_type
()
55
{
56
return
H5T_NATIVE_LONG;
57
}
58
59
int
sheaf::primitive_traits<long long int>::hdf_type
()
60
{
61
return
H5T_NATIVE_LLONG;
62
}
63
64
int
sheaf::primitive_traits<unsigned char>::hdf_type
()
65
{
66
return
H5T_NATIVE_UCHAR;
67
}
68
69
int
sheaf::primitive_traits<unsigned short int>::hdf_type
()
70
{
71
return
H5T_NATIVE_USHORT;
72
}
73
74
int
sheaf::primitive_traits<unsigned int>::hdf_type
()
75
{
76
return
H5T_NATIVE_UINT;
77
}
78
79
int
sheaf::primitive_traits<unsigned long int>::hdf_type
()
80
{
81
return
H5T_NATIVE_ULONG;
82
}
83
84
int
sheaf::primitive_traits<unsigned long long int>::hdf_type
()
85
{
86
return
H5T_NATIVE_ULLONG;
87
}
88
89
int
sheaf::primitive_traits<float>::hdf_type
()
90
{
91
return
H5T_NATIVE_FLOAT;
92
}
93
94
int
sheaf::primitive_traits<double>::hdf_type
()
95
{
96
return
H5T_NATIVE_DOUBLE;
97
}
98
99
int
sheaf::primitive_traits<long double>::hdf_type
()
100
{
101
return
H5T_NATIVE_LDOUBLE;
102
}
103
104
int
sheaf::primitive_traits<sheaf::void_star>::hdf_type
()
105
{
106
int
result = -1;
107
if
(
sizeof
(
void
*) ==
sizeof
(
unsigned
int
))
108
{
109
result = H5T_NATIVE_UINT;
110
}
111
else
if
(
sizeof
(
void
*) ==
sizeof
(
unsigned
long
))
112
{
113
result = H5T_NATIVE_ULONG;
114
}
115
else
if
(
sizeof
(
void
*) ==
sizeof
(
unsigned
long
long
))
116
{
117
result = H5T_NATIVE_ULLONG;
118
}
119
else
120
{
121
post_fatal_error_message(
"Unable to match sheaf primitive void_star with HDF type."
);
122
}
123
124
return
result;
125
}
126
127
int
sheaf::primitive_traits<sheaf::c_string>::hdf_type
()
128
{
129
return
H5T_C_S1;
130
}
131
132
int
sheaf::primitive_traits<sheaf::namespace_relative_member_index_pod_type>::hdf_type
()
133
{
134
// The sheaf type is a struct with this type as the type of its members.
135
// See file_data_type_map::create_internal_hdf_types().
136
137
return
H5T_NATIVE_INT;
138
}
139
140
int
sheaf::primitive_traits<sheaf::namespace_relative_subposet_index_pod_type>::hdf_type
()
141
{
142
// The sheaf type is a struct with this type as the type of its members.
143
// See file_data_type_map::create_internal_hdf_types().
144
145
return
H5T_NATIVE_INT;
146
}
147
148
int
sheaf::primitive_traits<void>::hdf_type
()
149
{
150
// The sheaf type is a struct with this type as the type of its members.
151
// See file_data_type_map::create_internal_hdf_types().
152
153
return
-1;
154
}
155
156
157
158
sheaf::primitive_traits::hdf_type
static int hdf_type()
The hdf type used to represent T in the hdf file.
Definition:
primitive_traits.cc:104
sheaves
support
primitive_traits.cc
Generated on Sun Jul 9 2017 14:27:26 for SheafSystem by
1.8.13