libdap++
Updated for version 3.14.0
|
#include <DMR.h>
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. More... | |
string | dmr_version () const |
virtual void | dump (ostream &strm) const |
dumps information about this object More... | |
string | get_namespace () const |
Get the namespace associated with the DDS - likely set only by DDX responses. More... | |
bool | OK () const |
DMR & | operator= (const DMR &rhs) |
void | print_dap4 (XMLWriter &xml, bool constrained=false) |
long | request_size (bool constrained) |
Get the estimated response size, in kilo bytes. More... | |
string | request_xml_base () const |
Get the URL that will return this DMR/DDX/DataThing. More... | |
long | response_limit () |
Get the maximum response size, in KB. Zero indicates no limit. More... | |
D4Group * | root () |
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. More... | |
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 D4BaseTypeFactory * | factory () |
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 |
DMR is root object for a DAP4 dataset. It holds a D4Group and other information about the dataset (DAP protocol number, DMR version, etc.).
libdap::DMR::DMR | ( | ) |
Make a DMR which uses the given BaseTypeFactory to create variables.
Definition at line 180 of file DMR.cc.
References set_dap_version().
libdap::DMR::DMR | ( | const DMR & | rhs | ) |
The DMR copy constructor.
Definition at line 190 of file DMR.cc.
References m_duplicate().
libdap::DMR::DMR | ( | D4BaseTypeFactory * | factory, |
const string & | name = "" |
||
) |
Make a DMR which uses the given BaseTypeFactory to create variables.
factory | The 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. |
name | The name of the DMR - usually derived from the name of the pathname or table name of the dataset. |
Definition at line 118 of file DMR.cc.
References set_dap_version().
libdap::DMR::DMR | ( | D4BaseTypeFactory * | factory, |
DDS & | 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.
factory | Factory class used to make new variables |
dds | Get the variables to convert from this DAP2 DDS. |
Definition at line 148 of file DMR.cc.
References libdap::Constructor::add_var_nocopy(), libdap::BaseType::attributes(), build_using_dds(), libdap::DDS::get_attr_table(), root(), set_dap_version(), libdap::D4Attributes::transform_to_dap4(), libdap::BaseType::transform_to_dap4(), libdap::DDS::var_begin(), and libdap::DDS::var_end().
|
virtual |
|
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.
dds | Read variables and Attributes from this DDS |
Definition at line 224 of file DMR.cc.
References libdap::Constructor::add_var_nocopy(), libdap::BaseType::attributes(), libdap::DDS::filename(), libdap::DDS::get_attr_table(), libdap::DDS::get_dataset_name(), root(), set_filename(), set_name(), libdap::D4Attributes::transform_to_dap4(), libdap::BaseType::transform_to_dap4(), libdap::DDS::var_begin(), and libdap::DDS::var_end().
Referenced by DMR().
|
inline |
Definition at line 140 of file DMR.h.
Referenced by print_dap4(), libdap::D4Connect::read_data_no_mime(), and libdap::D4Connect::read_dmr_no_mime().
|
inline |
Definition at line 145 of file DMR.h.
Referenced by print_dap4().
|
virtual |
Displays the pointer value of this instance and then calls parent dump
strm | C++ i/o stream to dump the information to |
Implements libdap::DapObj.
Definition at line 367 of file DMR.cc.
References libdap::DapIndent::Indent(), libdap::DapIndent::LMarg(), and libdap::DapIndent::UnIndent().
|
inlinevirtual |
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.
|
inline |
|
inline |
Definition at line 155 of file DMR.h.
Referenced by print_dap4().
|
protected |
Definition at line 76 of file DMR.cc.
References DBG, OK(), and libdap::D4Group::ptr_duplicate().
Referenced by DMR(), and operator=().
|
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.
Referenced by print_dap4().
|
inline |
Class invariant. If true, any method can be used.
Definition at line 109 of file DMR.h.
Referenced by m_duplicate().
Definition at line 206 of file DMR.cc.
References m_duplicate().
void libdap::DMR::print_dap4 | ( | XMLWriter & | xml, |
bool | constrained = false |
||
) |
Print the DAP4 DMR object.
xml | use this XMLWriter to build the XML. |
constrained | Should the DMR be subject to a constraint? Defaults to False |
Definition at line 314 of file DMR.cc.
References c_dap_40_n_sl, c_xml_namespace, c_xml_xsi, dap_version(), dmr_version(), get_namespace(), libdap::XMLWriter::get_writer(), name(), libdap::D4Group::print_dap4(), request_xml_base(), and root().
Referenced by main().
long libdap::DMR::request_size | ( | bool | constrained | ) |
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.
constrained | Should the size of the whole DMR be used or should the current constraint be taken into account? |
Definition at line 301 of file DMR.cc.
References libdap::D4Group::request_size().
|
inline |
Definition at line 149 of file DMR.h.
Referenced by print_dap4().
D4Group * libdap::DMR::root | ( | ) |
Return the root group of this Dataset. If no root group has been set, use the D4BaseType factory to make it.
Definition at line 243 of file DMR.cc.
References libdap::dods_group_c, and libdap::D4BaseTypeFactory::NewVariable().
Referenced by build_using_dds(), DMR(), libdap::D4ParserSax2::dmr_start_document(), libdap::D4ParserSax2::dmr_start_element(), print_dap4(), and libdap::D4Connect::request_dap4_data().
void libdap::DMR::set_dap_version | ( | const string & | v | ) |
Given the DAP protocol version, parse that string and set the DMR fields.
v | The version string. |
Definition at line 255 of file DMR.cc.
References c_dap40_namespace.
Referenced by DMR(), and libdap::D4ParserSax2::dmr_start_element().
|
inline |
Definition at line 146 of file DMR.h.
Referenced by libdap::D4ParserSax2::dmr_start_element().
|
inlinevirtual |
|
inline |
Definition at line 137 of file DMR.h.
Referenced by build_using_dds().
|
inline |
Definition at line 118 of file DMR.h.
Referenced by build_using_dds(), and libdap::D4ParserSax2::dmr_start_element().
|
inline |
Definition at line 158 of file DMR.h.
Referenced by libdap::D4ParserSax2::dmr_start_element().
|
inline |
Definition at line 152 of file DMR.h.
Referenced by libdap::D4ParserSax2::dmr_start_element().
|
inline |