libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
AISConnect.cc
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2002,2003 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 #include "config.h"
27 
28 #include "AISConnect.h"
29 
30 namespace libdap {
31 
40 AISConnect::AISConnect(const string &name) throw(AISDatabaseReadFailed)
41  : Connect(name), d_ais_merge(0)
42 {
43  const string &ais_db = RCReader::instance()->get_ais_database();
44  if (ais_db != "")
45  d_ais_merge = new AISMerge(ais_db);
46 }
47 
57 AISConnect::AISConnect(const string &name, const string &ais)
59  : Connect(name), d_ais_merge(0)
60 {
61  d_ais_merge = new AISMerge(ais);
62 }
63 
66 {
67  delete d_ais_merge; d_ais_merge = 0;
68 }
69 
78 void
80 {
82 
83  if (d_ais_merge)
84  d_ais_merge->merge(URL(false), das); // URL(false) --> URL w/o CE
85 }
86 
87 } // namespace libdap
virtual string URL(bool CE=true)
Get the object&#39;s URL.
Definition: Connect.cc:1127
virtual void request_das(DAS &das)
Definition: AISConnect.cc:79
Holds information about the link from a DAP2 client to a dataset.
Definition: Connect.h:129
top level DAP object to house generic methods
Definition: AISConnect.cc:30
virtual void merge(const string &primary, DAS &das)
Definition: AISMerge.cc:82
Merge AIS resources.
Definition: AISMerge.h:64
virtual void request_das(DAS &das)
Get the DAS from a server.
Definition: Connect.cc:430
Hold attribute data for a DAP2 dataset.
Definition: DAS.h:121
virtual ~AISConnect()
Definition: AISConnect.cc:65