bes  Updated for version 3.20.10
DMRpp.h
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of the BES
5 
6 // Copyright (c) 2016 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 #ifndef MODULES_DMRPP_MODULE_DMRPP_H_
26 #define MODULES_DMRPP_MODULE_DMRPP_H_
27 
28 #include <string>
29 
30 #include <libdap/DMR.h>
31 
32 namespace libdap {
33 class DDS;
34 class XMLWriter;
35 }
36 
37 namespace dmrpp {
38 
39 class DmrppTypeFactory;
40 
44 class DMRpp : public libdap::DMR {
45 private:
46  std::string d_href;
47  std::string d_version;
48  bool d_print_chunks;
49 
50 public:
51  DMRpp() : DMR() { }
52  DMRpp(const DMRpp &dmrpp) : DMR(dmrpp) { }
53 
54  DMRpp(DmrppTypeFactory *factory, const std::string &name = "");
55 
56  virtual ~DMRpp() { }
57 
58  virtual std::string get_href() const { return d_href; }
59  virtual void set_href(const std::string &h) { d_href = h; }
60 
61  // These new methods hold the DMR++ builder version. I changed the XML attribute
62  // to 'dmrpp:version' jhrg 11/9/21
63  virtual std::string get_version() const { return d_version; }
64  virtual void set_version(const std::string &version) { d_version = version; }
65 
66  virtual bool get_print_chunks() const { return d_print_chunks; }
67  virtual void set_print_chunks(bool pc) { d_print_chunks = pc; }
68 
69  virtual libdap::DDS *getDDS();
70 
71  void print_dap4(libdap::XMLWriter &xml, bool constrained = false);
72 
73  virtual void print_dmrpp(libdap::XMLWriter &xml, const std::string &href ="", bool constrained = false, bool print_chunks = true);
74 };
75 
76 } /* namespace dmrpp */
77 
78 #endif /* MODULES_DMRPP_MODULE_DMRPP_H_ */
Provide a way to print the DMR++ response.
Definition: DMRpp.h:44
virtual void print_dmrpp(libdap::XMLWriter &xml, const std::string &href="", bool constrained=false, bool print_chunks=true)
Print the DMR++ response.
Definition: DMRpp.cc:71
void print_dap4(libdap::XMLWriter &xml, bool constrained=false)
override DMR::print_dap4() so the chunk info will print too.
Definition: DMRpp.cc:140