bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESDDSResponse.cc
1// BESDDSResponse.cc
2
3// This file is part of bes, A C++ back-end server implementation framework
4// for the OPeNDAP Data Access Protocol.
5
6// Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7// Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
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 University Corporation for Atmospheric Research at
24// 3080 Center Green Drive, Boulder, CO 80301
25
26// (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27// Please read the full copyright statement in the file COPYRIGHT_UCAR.
28//
29// Authors:
30// pwest Patrick West <pwest@ucar.edu>
31// jgarcia Jose Garcia <jgarcia@ucar.edu>
32
33#include <libdap/DDS.h>
34
35#include "BESDDSResponse.h"
36
37using namespace libdap;
38
39BESDDSResponse::~BESDDSResponse()
40{
41 delete _dds;
42 _dds = 0;
43
44 // Original code follows. Note that the part where the BaseType
45 // Factory was deleted was a bug that showed up when we started using
46 // the memory caches for DDS and DAS objects.
47 // See: https://opendap.atlassian.net/browse/HYRAX-254. jhrg 9/20/16
48#if 0
49 if (_dds) {
50 // Should the BES be deleting stuff inside a DDS object? How does
51 // the BES know this is not allocated on the stack?
52 if (_dds->get_factory())
53 delete _dds->get_factory();
54
55 delete _dds;
56 }
57#endif
58}
59
64void BESDDSResponse::set_container(const string &cn)
65{
66 if (_dds && get_explicit_containers()) {
67 _dds->container_name(cn);
68 }
69}
70
74{
75 if (_dds) {
76 _dds->container_name("");
77 }
78}
79
89{
90 strm << BESIndent::LMarg << "BESDDSResponse::dump - (" << (void *) this << ")" << endl;
91 BESIndent::Indent();
92 if (_dds) {
93 strm << BESIndent::LMarg << "DDS:" << endl;
94 BESIndent::Indent();
95 BESIndent::SetIndent(BESIndent::GetIndent());
96 _dds->dump(strm);
97 BESIndent::Reset();
98 BESIndent::UnIndent();
99 }
100 else {
101 strm << BESIndent::LMarg << "DDS: null" << endl;
102 }
103 BESIndent::UnIndent();
104}
105
virtual void set_container(const std::string &cn)
set the container in the DAP response object
virtual void dump(std::ostream &strm) const
dumps information about this object set container in catalog values avhrr, /data/ff/1998....
virtual void clear_container()
clear the container in the DAP response object
bool get_explicit_containers() const
Should containers be explicitly represented in the DD* responses?
STL class.