Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Resource Class Reference

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

#include <Resource.h>

Collaboration diagram for Resource:

Collaboration graph
[legend]
List of all members.

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 (const string &u, const string &r) throw (Error)
 Resource (const string &u, const rule &r)
 Resource (const string &u)
 Resource ()
virtual void set_rule (const Resource::rule &r)
virtual void set_url (const string &u)
virtual ~Resource ()

Friends

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

Detailed Description

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 <jgallagher@opendap.org>

Definition at line 47 of file Resource.h.


Member Enumeration Documentation

enum Resource::rule
 

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 <jgallagher@opendap.org>
Enumeration values:
overwrite 
replace 
fallback 

Definition at line 68 of file Resource.h.

Referenced by get_rule().


Constructor & Destructor Documentation

Resource::Resource  )  [inline]
 

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

Definition at line 72 of file Resource.h.

Resource::Resource const string &  u  )  [inline]
 

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

Parameters:
u The ancillary resource URL.

Definition at line 78 of file Resource.h.

Resource::Resource const string &  u,
const rule r
[inline]
 

Build a Resource.

Parameters:
u The ancillary resource URL.
r The combination rule.

Definition at line 84 of file Resource.h.

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:
u The ancillary resource URL.
r The name of the combination rule.

Definition at line 97 of file Resource.h.

virtual Resource::~Resource  )  [inline, virtual]
 

Definition at line 109 of file Resource.h.


Member Function Documentation

virtual Resource::rule Resource::get_rule  )  const [inline, virtual]
 

Return combination rule for this resource.

Definition at line 126 of file Resource.h.

References rule.

virtual string Resource::get_url  )  const [inline, virtual]
 

Return the resource URL.

Definition at line 113 of file Resource.h.

virtual void Resource::set_rule const Resource::rule r  )  [inline, virtual]
 

Set the resource's combination rule.

Parameters:
r The combination rule.

Definition at line 133 of file Resource.h.

virtual void Resource::set_url const string &  u  )  [inline, virtual]
 

Set the resource URL.

Parameters:
u The resource's URL.

Definition at line 120 of file Resource.h.


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
const Resource r
[friend]
 

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

See also:
Resource.

Definition at line 42 of file AISResources.cc.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 06:47:16 2007 for libdap++ by  doxygen 1.3.9.1