32#include <libdap/InternalErr.h>
40HDF5CFUInt16::HDF5CFUInt16(
const string &n,
const string &d) :
UInt16(n, d)
44HDF5CFUInt16::HDF5CFUInt16(
const string &n,
const string &d,
const string &d_f) :
UInt16(n, d),filename(d_f)
48BaseType *HDF5CFUInt16::ptr_duplicate()
50 auto HDF5CFUInt16_unique = make_unique<HDF5CFUInt16>(*
this);
51 return HDF5CFUInt16_unique.release();
54bool HDF5CFUInt16::read()
57 BESDEBUG(
"h5",
"Coming to HDF5CFUInt16 read "<<endl);
63 if ((file_id = H5Fopen(filename.c_str(),H5F_ACC_RDONLY,H5P_DEFAULT))<0) {
64 throw InternalErr (__FILE__, __LINE__,
"Failed to obtain the HDF5 file ID.");
69 dset_id = H5Dopen2(file_id,dataset().c_str(),H5P_DEFAULT);
72 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the dataset .");
82 if (H5Dclose(dset_id) < 0) {
83 throw InternalErr(__FILE__, __LINE__,
"Unable to close the dset.");
This class provides a way to map HDF5 unsigned 16-bit integer to DAP uint16 for the CF option.
void get_data(hid_t dset, void *buf)