OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESDDSResponse.cc
Go to the documentation of this file.
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 "BESDDSResponse.h"
34 
36 {
37  if (_dds) {
38  // FIXME Should the BES be deleting stuff inside a DDS object? How does
39  // the BES know this is not allocated on the stack?
40  if (_dds->get_factory())
41  delete _dds->get_factory();
42  delete _dds;
43  }
44 }
45 
50 void
51 BESDDSResponse::set_container( const string &cn )
52 {
53  if( _dds && get_explicit_containers() )
54  {
55  _dds->container_name( cn ) ;
56  }
57 }
58 
61 void
63 {
64  if( _dds )
65  {
66  _dds->container_name( "" ) ;
67  }
68 }
69 
78 void
79 BESDDSResponse::dump( ostream &strm ) const
80 {
81  strm << BESIndent::LMarg << "BESDDSResponse::dump - ("
82  << (void *)this << ")" << endl ;
84  if( _dds )
85  {
86  strm << BESIndent::LMarg << "DDS:" << endl ;
88  DapIndent::SetIndent( BESIndent::GetIndent() ) ;
89  _dds->dump( strm ) ;
90  DapIndent::Reset() ;
92  }
93  else
94  {
95  strm << BESIndent::LMarg << "DDS: null" << endl ;
96  }
98 }
99 
bool get_explicit_containers() const
Should containers be explicitly represented in the DD* responses?
virtual ~BESDDSResponse()
static const string & GetIndent()
Definition: BESIndent.cc:61
static void Indent()
Definition: BESIndent.cc:38
static ostream & LMarg(ostream &strm)
Definition: BESIndent.cc:73
virtual void clear_container()
clear the container in the DAP response object
virtual void dump(ostream &strm) const
dumps information about this object set container in catalog values avhrr, /data/ff/1998.6.avhrr.dat;
virtual void set_container(const string &cn)
set the container in the DAP response object
static void UnIndent()
Definition: BESIndent.cc:44