bes  Updated for version 3.20.10
DmrppUrl.cc
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 #include "config.h"
26 
27 #include <string>
28 
29 #include <BESError.h>
30 #include <BESDebug.h>
31 
32 #include "DmrppUrl.h"
33 
34 using namespace libdap;
35 using namespace std;
36 
37 namespace dmrpp {
38 
39 DmrppUrl &
40 DmrppUrl::operator=(const DmrppUrl &rhs)
41 {
42  if (this == &rhs)
43  return *this;
44 
45  dynamic_cast<Url &>(*this) = rhs; // run Constructor=
46 
47  dynamic_cast<DmrppCommon &>(*this) = rhs;
48  //DmrppCommon::m_duplicate_common(rhs);
49 
50  return *this;
51 }
52 
53 bool
54 DmrppUrl::read()
55 {
56  if (!get_chunks_loaded())
57  load_chunks(this);
58 
59  if (read_p())
60  return true;
61 
62  string value = read_atomic(name());
63 
64  set_value(value); // sets read_p too
65 
66  return true;
67 }
68 
69 void
70 DmrppUrl::set_send_p(bool state)
71 {
72  if (!get_attributes_loaded())
73  load_attributes(this);
74 
75  Url::set_send_p(state);
76 }
77 
78 void DmrppUrl::dump(ostream & strm) const
79 {
80  strm << BESIndent::LMarg << "DmrppUrl::dump - (" << (void *) this << ")" << endl;
81  BESIndent::Indent();
82  DmrppCommon::dump(strm);
83  Url::dump(strm);
84  strm << BESIndent::LMarg << "value: " << d_buf << endl;
85  BESIndent::UnIndent();
86 }
87 
88 } // namespace dmrpp
89