Associate a rule with an ancillary resource.
More...
#include <Resource.h>
|
enum | rule { overwrite
, replace
, fallback
} |
| How are ancillary resources used. More...
|
|
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.
◆ 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.
◆ 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
-
u | The 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
-
u | The ancillary resource URL. |
r | The 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
-
u | The ancillary resource URL. |
r | The name of the combination rule. |
Definition at line 100 of file Resource.h.
◆ ~Resource()
virtual libdap::Resource::~Resource |
( |
| ) |
|
|
inlinevirtual |
◆ get_rule()
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()
Set the resource's combination rule.
- Parameters
-
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
-
Definition at line 123 of file Resource.h.
◆ operator<<
ostream & operator<< |
( |
ostream & | os, |
|
|
const Resource & | r ) |
|
friend |
Write the XML for this resource. This function is defined in AISResoruces.
- Parameters
-
os | Write to this ostream. @paran r The Resource to write. |
The documentation for this class was generated from the following file: