bes Updated for version 3.20.10
HDF5_DDS.h
1
2// This file is part of the hdf4 data handler for the OPeNDAP data server.
3//
4// Author: Kent Yang <myang6@hdfgroup.org>
5// Copyright (c) 2010-2012 The HDF Group
6// The idea is borrowed from HDF4 OPeNDAP handler that is implemented by
7// James Gallagher<jgallagher@opendap.org>
8
9#ifndef HDF5_DDS_H_
10#define HDF5_DDS_H_
11
12#include "config_hdf5.h"
13
14
15#include "hdf5.h"
16
17
18#include <libdap/DDS.h>
19#include <libdap/InternalErr.h>
20
21
37class HDF5DDS : public libdap::DDS {
38private:
39 hid_t fileid;
40
41 void m_duplicate(const HDF5DDS &src)
42 {
43 fileid = src.fileid;
44 }
45
46public:
47 explicit HDF5DDS(libdap::DDS *ddsIn) : libdap::DDS(*ddsIn), fileid(-1) {}
48
49 HDF5DDS(const HDF5DDS &rhs) : libdap::DDS(rhs) {
50 m_duplicate(rhs);
51 }
52
53 HDF5DDS & operator= (const HDF5DDS &rhs) {
54 if (this == &rhs)
55 return *this;
56
57 m_duplicate(rhs);
58
59 return *this;
60 }
61
62 virtual ~HDF5DDS() {
63
64 if (fileid != -1)
65 H5Fclose(fileid);
66
67 }
68
69 // I think this should be set_fileid(...). jhrg 2/18/16
70 void setHDF5Dataset(const hid_t fileid_in) {
71 fileid = fileid_in;
72 }
73
74};
75
76#endif
77
78
79