#include <AISMerge.h>
Public Member Functions | |
AISMerge (const string &database) throw (AISDatabaseReadFailed) | |
virtual Response * | get_ais_resource (const string &res) |
virtual void | merge (const string &primary, DAS &das) |
virtual | ~AISMerge () |
Friends | |
class | AISMergeTest |
Definition at line 64 of file AISMerge.h.
libdap::AISMerge::AISMerge | ( | const string & | database | ) | throw (AISDatabaseReadFailed) [inline] |
Initialize an instance so that it reads from database
.
database | Name of a database of AIS resources. |
AISDatabaseReadFailed | Thrown if the named database cannot be opened. |
Definition at line 76 of file AISMerge.h.
virtual libdap::AISMerge::~AISMerge | ( | ) | [inline, virtual] |
Destroy an instance. This is explicitly declared virtual to support subclassing.
Definition at line 82 of file AISMerge.h.
Response * libdap::AISMerge::get_ais_resource | ( | const string & | res | ) | [virtual] |
Access an AIS resource. The resource may be a local file or a URL. Assume all resource URIs have no leading spaces. This method is public so that a client of libdap++ can specialize its behavior. This implementation dereferences a URL or opens a file and returns a FILE pointer which can be used to read the contents. In the case of a URL, 'the contents' means the body of the HTTP response. For a file, it means the entire file.
res | The AIS resource. |
Definition at line 51 of file AISMerge.cc.
References libdap::HTTPConnect::fetch_url().
Referenced by merge().
void libdap::AISMerge::merge | ( | const string & | primary, | |
DAS & | das | |||
) | [virtual] |
Access the AIS ancillary resources matched to primary
and merge those with the DAS object das.
This method uses AISResources::has_resource(...) to determine if primary
has an entry in the AIS database. It uses AISResources::get_resource(...) to get a ResourceVector of AIS resources for primary
. It then uses its own get_ais_resources(...) to access the actual resources via a FILE pointer. Clients may use this information to specialize AISMerge::merge(...).
primary | The URL of the primary resource. | |
das | The target of the merge operation. This must already contain the DAS for primary. |
Definition at line 82 of file AISMerge.cc.
References libdap::DAS::erase(), libdap::Resource::fallback, get_ais_resource(), libdap::Error::get_error_message(), libdap::AISResources::get_resource(), libdap::DAS::get_size(), libdap::Response::get_stream(), libdap::AISResources::has_resource(), libdap::Resource::overwrite, libdap::DAS::parse(), and libdap::Resource::replace.
Referenced by libdap::AISConnect::request_das().
friend class AISMergeTest [friend] |
Definition at line 70 of file AISMerge.h.