bes  Updated for version 3.20.6
HDF5_DMR.h
1 // 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_DMR_H_
10 #define HDF5_DMR_H_
11 
12 #include "config_hdf5.h"
13 
14 
15 #include "hdf5.h"
16 
17 
18 //#define USE_DAP4 1
19 //#undef USE_DAP4
20 //#ifdef USE_DAP4
21 #include <DMR.h>
22 //#include <InternalErr.h>
23 
24 
40 class HDF5DMR : public libdap::DMR {
41 private:
42  hid_t fileid;
43 
44  void m_duplicate(const HDF5DMR &src)
45  {
46  fileid = src.fileid;
47  }
48 
49 public:
50  HDF5DMR(libdap::DMR *dmr) : libdap::DMR(*dmr), fileid(-1) {}
51  HDF5DMR(libdap::D4BaseTypeFactory *factory,const string &name):libdap::DMR(factory,name),fileid(-1) {}
52 
53  HDF5DMR(const HDF5DMR &rhs) : libdap::DMR(rhs) {
54  m_duplicate(rhs);
55  }
56 
57  HDF5DMR & operator= (const HDF5DMR &rhs) {
58  if (this == &rhs)
59  return *this;
60 
61  dynamic_cast<libdap::DMR &>(*this) = rhs;
62  m_duplicate(rhs);
63 
64  return *this;
65  }
66 
67  ~HDF5DMR() {
68 
69  if (fileid != -1)
70  H5Fclose(fileid);
71 
72  }
73 
74  void setHDF5Dataset(const hid_t fileid_in) {
75  fileid = fileid_in;
76  }
77 
78 };
79 
80 //#endif
81 #endif
82 
83 
84 
HDF5DMR
Definition: HDF5_DMR.h:40