43 #include "InternalErr.h"
79 if (H5Tclose(ty_id) < 0) {
80 throw InternalErr(__FILE__, __LINE__,
"Unable to close the datatype.");
82 if (H5Dclose(dset_id) < 0) {
83 throw InternalErr(__FILE__, __LINE__,
"Unable to close the dset.");
89 DBG(cerr <<
"=read(): Structure" << endl);
90 BaseType *q = get_parent();
92 throw InternalErr(__FILE__, __LINE__,
"null pointer");
97 int i = H5Tget_nmembers(ty_id);
99 throw InternalErr(__FILE__, __LINE__,
"H5Tget_nmembers() failed.");
107 string myname = name();
110 hid_t s2_float64_tid = H5Tcreate(H5T_COMPOUND,
sizeof(
s2_float64_t));
113 if (s2_float64_tid < 0) {
114 throw InternalErr(__FILE__, __LINE__,
"cannot create a new datatype");
117 DBG(cerr <<
"=read() ty_id=" << ty_id <<
" name=" << myname <<
118 " size=" << i << endl);
120 if (q->is_constructor_type()) {
123 if (H5Tinsert(s2_float64_tid, myname.c_str(), HOFFSET(
s2_float64_t, a), H5T_NATIVE_DOUBLE) < 0) {
124 throw InternalErr(__FILE__, __LINE__,
"Unable to add datatype.");
128 stemp_tid = H5Tcreate(H5T_COMPOUND,
sizeof(
s2_float64_t));
130 throw InternalErr(__FILE__, __LINE__,
"cannot create a new datatype");
132 if (H5Tinsert(stemp_tid, parent_name.c_str(), 0, s2_float64_tid) < 0) {
133 throw InternalErr(__FILE__, __LINE__,
"Unable to add datatype.");
135 s2_float64_tid = stemp_tid;
137 parent_name = q->name();
149 if (H5Dread(dset_id, s2_float64_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf[0]) < 0) {
153 throw InternalErr(__FILE__, __LINE__,
"hdf5_dods server failed when getting int32 data for structure");
159 DBG(cerr <<
"index " << j << endl);
HDF5Float64(const string &n, const string &d)
Constructor.
This class converts HDF5 compound type into DAP structure for the default option. ...
string get_dap_type(hid_t type)
returns the string representation of HDF5 type.
int get_array_index()
returns the array index of this Structure if it's a part of array of structures.
Data structure and retrieval processing header for the default option.
void get_data(hid_t dset, void *buf)
will get all data of a dset dataset and put it into buf.
hid_t get_did()
returns HDF5 dataset id.
virtual BaseType * ptr_duplicate()
Clone this instance.
virtual bool read()
Reads HDF5 64-bit float data into local buffer.
A class for mapping HDF5 64-bit float to DAP for the default option.
hid_t get_tid()
returns HDF5 datatype id.
void set_did(hid_t dset)
remembers HDF5 dataset id.
int get_entire_array_size()
returns the entire array size of this Structure if it's a part of array of structures.
void set_tid(hid_t type)
remembers HDF5 datatype id.
struct s2_float64_t s2_float64_t