libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::AISMerge Class Reference

Merge AIS resources. More...

#include <AISMerge.h>

Public Member Functions

 AISMerge (const string &database) throw (AISDatabaseReadFailed)
 
virtual Responseget_ais_resource (const string &res)
 
virtual void merge (const string &primary, DAS &das)
 
virtual ~AISMerge ()
 

Friends

class AISMergeTest
 

Detailed Description

Merge AIS resources.

Manage a single AIS database. Open an AIS database and handle merging DAP objects with the ancillary resources it references. This class uses AISResources to actually open the AIS database and locate AIS resources for a particular primary data source. This class dereferences AIS resources returned by AISResources and merges that with an existing DAP object (currently only the DAS object is supported. 02/25/03 jhrg).

Definition at line 64 of file AISMerge.h.

Constructor & Destructor Documentation

◆ AISMerge()

libdap::AISMerge::AISMerge ( const string &  database)
throw (AISDatabaseReadFailed
)
inline

Initialize an instance so that it reads from database.

Parameters
databaseName of a database of AIS resources.
Exceptions
AISDatabaseReadFailedThrown if the named database cannot be opened.

Definition at line 76 of file AISMerge.h.

◆ ~AISMerge()

virtual libdap::AISMerge::~AISMerge ( )
inlinevirtual

Destroy an instance. This is explicitly declared virtual to support subclassing.

Definition at line 82 of file AISMerge.h.

Member Function Documentation

◆ get_ais_resource()

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.

Parameters
resThe AIS resource.
Returns
Either an open FILE * which points to the resource or null if the resource could not be opened. This method does not throw an exception for resources that cannot be opened because that can happen for a number of reasons which are hardly 'exceptional.'

Definition at line 51 of file AISMerge.cc.

◆ 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(...).

Parameters
primaryThe URL of the primary resource.
dasThe target of the merge operation. This must already contain the DAS for primary.

Definition at line 82 of file AISMerge.cc.


The documentation for this class was generated from the following files: