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

Associate a rule with an ancillary resource. More...

#include <Resource.h>

Public Types

enum  rule { overwrite, replace, fallback }
 How are ancillary resources used. More...
 

Public Member Functions

virtual Resource::rule get_rule () const
 
virtual string get_url () const
 
 Resource ()
 
 Resource (const string &u)
 
 Resource (const string &u, const rule &r)
 
 Resource (const string &u, const string &r) throw (Error)
 
virtual void set_rule (const Resource::rule &r)
 
virtual void set_url (const string &u)
 

Friends

ostream & operator<< (ostream &os, const Resource &r)
 

Detailed Description

Associate a rule with an ancillary resource.

Bind an ancillary resource with the rule that should be used when combining it with a primary resource. Ancillary resources are always specified using URLs. If an ancillary resource is a local file, use file:// URLs.

Note that operator<< is defined for Resource as a function.

Author
James Gallagher jgall.nosp@m.aghe.nosp@m.r@ope.nosp@m.ndap.nosp@m..org

Definition at line 50 of file Resource.h.

Member Enumeration Documentation

◆ rule

How are ancillary resources used.

The AIS uses this enumeration to describe how a given ancillary should be merged into a primary data source.

  • overwrite: Attributes in the ancillary source overwrite those in the primary source. New values are added.
  • replace: The ancillary source replaces the primary. All of the Attributes in the primary are removed.
  • fallback: The ancillary resource provides a set of fallback values if the primary data source lacks any attributes. Note that this does not apply to individual attributes, but to an entire set. The fallback attributes are used only if the original data source lacks attributes altogether.
Author
James Gallagher jgall.nosp@m.aghe.nosp@m.r@ope.nosp@m.ndap.nosp@m..org

Definition at line 71 of file Resource.h.

Constructor & Destructor Documentation

◆ Resource() [1/4]

libdap::Resource::Resource ( )
inline

Build a Resource with a null URL and set the combination rule to the default.

Definition at line 75 of file Resource.h.

◆ Resource() [2/4]

libdap::Resource::Resource ( const string &  u)
inline

Build a resource. Set the combination rule to the default value, which is overwrite.

Parameters
uThe ancillary resource URL.

Definition at line 81 of file Resource.h.

◆ Resource() [3/4]

libdap::Resource::Resource ( const string &  u,
const rule r 
)
inline

Build a Resource.

Parameters
uThe ancillary resource URL.
rThe combination rule.

Definition at line 87 of file Resource.h.

◆ Resource() [4/4]

libdap::Resource::Resource ( const string &  u,
const string &  r 
)
throw (Error
)
inline

Build a Resource.

Note: If this is used in a callback, make sure to check the value of r before calling this constructor. Exceptions thrown within callbacks are not portable. Valid values are "overwrite", "replace" and "fallback". The constructor accepts "default" as a synonym for "overwrite".

Parameters
uThe ancillary resource URL.
rThe name of the combination rule.

Definition at line 100 of file Resource.h.

Member Function Documentation

◆ get_rule()

virtual Resource::rule libdap::Resource::get_rule ( ) const
inlinevirtual

Return combination rule for this resource.

Definition at line 129 of file Resource.h.

◆ get_url()

virtual string libdap::Resource::get_url ( ) const
inlinevirtual

Return the resource URL.

Definition at line 116 of file Resource.h.

◆ set_rule()

virtual void libdap::Resource::set_rule ( const Resource::rule r)
inlinevirtual

Set the resource's combination rule.

Parameters
rThe combination rule.

Definition at line 136 of file Resource.h.

◆ set_url()

virtual void libdap::Resource::set_url ( const string &  u)
inlinevirtual

Set the resource URL.

Parameters
uThe resource's URL.

Definition at line 123 of file Resource.h.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Resource r 
)
friend

Write the XML for this resource. This function is defined in AISResoruces.

Parameters
osWrite to this ostream. r The Resource to write.

Output the XML fragment for a Resource. This function is a friend of the Resource class.

Parameters
osoutput stream
rResource to write out.
See also
Resource.

Definition at line 46 of file AISResources.cc.


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