OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
GDAL_DDS.h
Go to the documentation of this file.
1 // This file is part of the GDAL OPeNDAP Adapter
2 
3 // Copyright (c) 2012 OPeNDAP, Inc.
4 // Author: James Gallagher <jgallagher@opendap.org>
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
21 
22 #ifndef GDAL_DDS_H_
23 #define GDAL_DDS_H_
24 
25 #include "config.h"
26 
27 #include <gdal.h>
28 
29 #include <DataDDS.h>
30 #include <InternalErr.h>
31 
32 using namespace libdap;
33 
49 class GDALDDS : public DataDDS {
50 private:
51  GDALDatasetH d_hDS;
52 
53  void m_duplicate(const GDALDDS &src) { d_hDS = src.d_hDS; }
54 
55 public:
56  GDALDDS(DataDDS *ddsIn) : DataDDS(*ddsIn), d_hDS(0) {}
57  GDALDDS(BaseTypeFactory *factory, const string &name) : DataDDS(factory, name), d_hDS(0) {}
58 
59  GDALDDS(const GDALDDS &rhs) : DataDDS(rhs) {
60  m_duplicate(rhs);
61  }
62 
63  GDALDDS & operator= (const GDALDDS &rhs) {
64  if (this == &rhs)
65  return *this;
66 
67  m_duplicate(rhs);
68 
69  return *this;
70  }
71 
73  if (d_hDS)
74  GDALClose(d_hDS);
75  }
76 
77  void setGDALDataset(const GDALDatasetH &hDSIn) { d_hDS = hDSIn; }
78  GDALDatasetH &GDALDataset() { return d_hDS; }
79 };
80 
81 
82 #endif /* GDAL_DDS_H_ */
This specialization of DDS is used to manage the 'resource' of the open GDAL dataset handle so that t...
Definition: GDAL_DDS.h:49
~GDALDDS()
Definition: GDAL_DDS.h:72
static class NCMLUtil overview
GDALDatasetH & GDALDataset()
Definition: GDAL_DDS.h:78
void setGDALDataset(const GDALDatasetH &hDSIn)
Definition: GDAL_DDS.h:77
GDALDDS(const GDALDDS &rhs)
Definition: GDAL_DDS.h:59
GDALDDS(BaseTypeFactory *factory, const string &name)
Definition: GDAL_DDS.h:57
GDALDDS(DataDDS *ddsIn)
Definition: GDAL_DDS.h:56