libdap  Updated for version 3.17.0
libdap::DMR Class Reference

#include <DMR.h>

Inheritance diagram for libdap::DMR:

List of all members.

Public Member Functions

virtual void build_using_dds (DDS &dds)
int dap_major () const
int dap_minor () const
string dap_version () const
 DMR ()
 DMR (const DMR &dmr)
 DMR (D4BaseTypeFactory *factory, const string &name="")
 DMR (D4BaseTypeFactory *factory, DDS &dds)
 Build a DMR using a DAP2 DDS.
string dmr_version () const
virtual void dump (ostream &strm) const
 dumps information about this object
string get_namespace () const
 Get the namespace associated with the DDS - likely set only by DDX responses.
bool OK () const
DMRoperator= (const DMR &rhs)
void print_dap4 (XMLWriter &xml, bool constrained=false)
long request_size (bool constrained)
 Get the estimated response size, in kilo bytes.
string request_xml_base () const
 Get the URL that will return this DMR/DDX/DataThing.
long response_limit ()
 Get the maximum response size, in KB. Zero indicates no limit.
D4Grouproot ()
void set_dap_version (const string &version_string)
void set_dmr_version (const string &v)
void set_namespace (const string &ns)
 Set the namespace for this DDS/DDX object/response.
void set_request_xml_base (const string &xb)
void set_response_limit (long size)
virtual ~DMR ()
string name () const
void set_name (const string &n)
virtual D4BaseTypeFactoryfactory ()
virtual void set_factory (D4BaseTypeFactory *f)
string filename () const
void set_filename (const string &fn)

Protected Member Functions

void m_duplicate (const DMR &dmr)

Friends

class DMRTest

Detailed Description

DMR is root object for a DAP4 dataset. It holds a D4Group and other information about the dataset (DAP protocol number, DMR version, etc.).

Note:
This class holds the dataset name and filename (which might actually be a database name, but it's usually a filename). The variables of a DAP4 dataset are held by the D4Group instance (which is a child of Constructor).

Definition at line 55 of file DMR.h.


Constructor & Destructor Documentation

Make a DMR which uses the given BaseTypeFactory to create variables.

Note:
The default DAP version is 4.0 - use the DDS class to make DAP2 things. The default DMR version is 1.0

Definition at line 179 of file DMR.cc.

libdap::DMR::DMR ( const DMR rhs)

The DMR copy constructor.

Definition at line 189 of file DMR.cc.

libdap::DMR::DMR ( D4BaseTypeFactory factory,
const string &  name = "" 
)

Make a DMR which uses the given BaseTypeFactory to create variables.

Note:
The default DAP version is 4.0 - use the DDS class to make DAP2 things. The default DMR version is 1.0
Parameters:
factoryThe D4BaseTypeFactory to use when creating instances of DAP4 variables. The caller must ensure the factory's lifetime is at least that of the DMR instance.
nameThe name of the DMR - usually derived from the name of the pathname or table name of the dataset.

Definition at line 117 of file DMR.cc.

libdap::DMR::DMR ( D4BaseTypeFactory factory,
DDS dds 
)

Build a DMR using a DAP2 DDS.

Given a DDS from code written for DAP2, build a DAP4 DMR object. This works because DAP4 subsumes DAP2, but there are a few quirks... For each variable in the DDS, transform it to the equivalent DAP4 variable type and then copy the variable's attributes. Most types convert easily. Types that need special treatment are: Array: DAP2 array dimensions must be morphed to DAP4 Sequence: Make a D4Sequence Grid: Make a coverage; assume Grids with the same dimension names have 'shared dimensions' and that maps with the same names are shared too.

Note:
Assume that a DDS has only a root group. This is not actually true for a DDS from the HDF5 handler, because it has Groups encoded into the variable names. jhrg 3/18/14
Parameters:
factoryFactory class used to make new variables
ddsGet the variables to convert from this DAP2 DDS.
See also:
BaseType::transform_to_dap4()

Definition at line 147 of file DMR.cc.

libdap::DMR::~DMR ( ) [virtual]

Delete a DMR. The BaseType factory is not freed, while the contained group is.

Definition at line 197 of file DMR.cc.


Member Function Documentation

void libdap::DMR::build_using_dds ( DDS dds) [virtual]

If we have a DDS that includes Attributes, use it to build the DMR. This will copy all of the variables in the DDS into the DMR using BaseType::transform_to_dap4(), so the actual types added can be controlled by code that specializes the various type classes.

Parameters:
ddsRead variables and Attributes from this DDS

Definition at line 223 of file DMR.cc.

void libdap::DMR::dump ( ostream &  strm) const [virtual]

dumps information about this object

Displays the pointer value of this instance and then calls parent dump

Parameters:
strmC++ i/o stream to dump the information to
Returns:
void

Implements libdap::DapObj.

Definition at line 366 of file DMR.cc.

virtual D4BaseTypeFactory* libdap::DMR::factory ( ) [inline, virtual]

Get/set the factory which makes instances of the variables. Specialize D4BaseTypeFactory so that a DMR will be populated with your client or server's specialized types.

Definition at line 125 of file DMR.h.

string libdap::DMR::filename ( ) const [inline]

get/set the dataset's 'filename.' The filename is a string that can be used to access the dataset's actual data store (it's usually a pathname to a file, but it might be a database key.

Todo:
Move this to Group?

Definition at line 136 of file DMR.h.

string libdap::DMR::get_namespace ( ) const [inline]

Get the namespace associated with the DDS - likely set only by DDX responses.

Definition at line 155 of file DMR.h.

string libdap::DMR::name ( ) const [inline]

Get and set the DMR's name. This is effectively the 'dataset' name. It should not be used to reference the dataset's data store (e.g., it should not be a pathname to a file). This will be used in error messages.

Definition at line 117 of file DMR.h.

bool libdap::DMR::OK ( ) const [inline]

Class invariant. If true, any method can be used.

Returns:
True if the instance is OK to use, false otherwise.

Definition at line 109 of file DMR.h.

void libdap::DMR::print_dap4 ( XMLWriter xml,
bool  constrained = false 
)

Print the DAP4 DMR object.

Parameters:
xmluse this XMLWriter to build the XML.
constrainedShould the DMR be subject to a constraint? Defaults to False

Definition at line 313 of file DMR.cc.

long libdap::DMR::request_size ( bool  constrained)

Get the estimated response size, in kilo bytes.

Get the size of a response, in kilobytes. This method looks at the variables in the DMR a computes the number of bytes in the response.

Note:
This version of the method does a poor job with Arrays that have varying dimensions.
Parameters:
constrainedShould the size of the whole DMR be used or should the current constraint be taken into account?
Returns:
The size of the request in kilobytes

Definition at line 300 of file DMR.cc.

string libdap::DMR::request_xml_base ( ) const [inline]

Get the URL that will return this DMR/DDX/DataThing.

Definition at line 149 of file DMR.h.

long libdap::DMR::response_limit ( ) [inline]

Get the maximum response size, in KB. Zero indicates no limit.

Definition at line 162 of file DMR.h.

Return the root group of this Dataset. If no root group has been set, use the D4BaseType factory to make it.

Returns:
The root group of the dataset.

Definition at line 242 of file DMR.cc.

void libdap::DMR::set_dap_version ( const string &  v)

Given the DAP protocol version, parse that string and set the DMR fields.

Parameters:
vThe version string.

Definition at line 254 of file DMR.cc.

void libdap::DMR::set_namespace ( const string &  ns) [inline]

Set the namespace for this DDS/DDX object/response.

Definition at line 158 of file DMR.h.

void libdap::DMR::set_request_xml_base ( const string &  xb) [inline]
See also:
get_request_xml_base

Definition at line 152 of file DMR.h.

void libdap::DMR::set_response_limit ( long  size) [inline]

Set the maximum response size. Zero is the default value. The size is given in kilobytes.

Parameters:
sizeThe maximum size of the response in kilobytes.

Definition at line 167 of file DMR.h.


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