78#include "InternalErr.h"
90const string c_xml_xsi =
"http://www.w3.org/2001/XMLSchema-instance";
91const string c_xml_namespace =
"http://www.w3.org/XML/1998/namespace";
93const string grddl_transformation_dap32 =
"http://xml.opendap.org/transforms/ddxToRdfTriples.xsl";
95const string c_default_dap20_schema_location =
"http://xml.opendap.org/dap/dap2.xsd";
96const string c_default_dap32_schema_location =
"http://xml.opendap.org/dap/dap3.2.xsd";
97const string c_default_dap40_schema_location =
"http://xml.opendap.org/dap/dap4.0.xsd";
99const string c_dap20_namespace =
"http://xml.opendap.org/ns/DAP2";
100const string c_dap32_namespace =
"http://xml.opendap.org/ns/DAP/3.2#";
101const string c_dap40_namespace =
"http://xml.opendap.org/ns/DAP/4.0#";
103const string c_dap_20_n_sl = c_dap20_namespace +
" " + c_default_dap20_schema_location;
104const string c_dap_32_n_sl = c_dap32_namespace +
" " + c_default_dap32_schema_location;
105const string c_dap_40_n_sl = c_dap40_namespace +
" " + c_default_dap40_schema_location;
110const string TOP_LEVEL_ATTRS_CONTAINER_NAME =
"DAP4_GLOBAL";
117void dds_switch_to_buffer(
void *new_buffer);
118void dds_delete_buffer(
void * buffer);
119void *dds_buffer(FILE *fp);
124DDS::duplicate(
const DDS &dds)
126 DBG(cerr <<
"Entering DDS::duplicate... " <<endl);
128 d_factory = dds.d_factory;
131 d_filename = dds.d_filename;
132 d_container_name = dds.d_container_name;
133 d_container = dds.d_container;
135 d_dap_major = dds.d_dap_major;
136 d_dap_minor = dds.d_dap_minor;
138 d_dap_version = dds.d_dap_version;
139 d_request_xml_base = dds.d_request_xml_base;
140 d_namespace = dds.d_namespace;
144 DDS &dds_tmp =
const_cast<DDS &
>(dds);
147 for (Vars_iter i = dds_tmp.var_begin(); i != dds_tmp.var_end(); i++) {
151 d_timeout = dds.d_timeout;
153 d_max_response_size_kb = dds.d_max_response_size_kb;
169 : d_factory(factory), d_name(name), d_container_name(
""), d_container(0),
170 d_request_xml_base(
""),
171 d_timeout(0), d_max_response_size_kb(0)
173 DBG(cerr <<
"Building a DDS for the default version (2.0)" << endl);
196 : d_factory(factory), d_name(name), d_container_name(
""), d_container(0),
197 d_request_xml_base(
""),
198 d_timeout(0), d_max_response_size_kb(0)
200 DBG(cerr <<
"Building a DDS for version: " << version << endl);
210 DBG(cerr <<
"Entering DDS(const DDS &rhs) ..." << endl);
212 DBG(cerr <<
" bye." << endl);
218 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
220 delete btp ; btp = 0;
225DDS::operator=(
const DDS &rhs)
252 if (d_container && das->container_name() != d_container_name)
254 "Error transferring attributes: working on a container in dds, but not das");
257 AttrTable *top = das->get_top_level_attributes();
260 (*i)->transfer_attributes(top);
265 for (AttrTable::Attr_iter i = top->attr_begin(), e = top->attr_end(); i != e; ++i) {
266 if ((*i)->type == Attr_container && (*i)->attributes->is_global_attribute()) {
341 if (d_dap_minor >= 0) {
343 oss << d_dap_major <<
"." << d_dap_minor;
344 d_dap_version = oss.str();
356 if (d_dap_major >= 0) {
358 oss << d_dap_major <<
"." << d_dap_minor;
359 d_dap_version = oss.str();
371 istringstream iss(v);
373 int major = -1, minor = -1;
375 if (!iss.eof() && !iss.fail())
377 if (!iss.eof() && !iss.fail())
379 if (!iss.eof() && !iss.fail())
382 if (major == -1 || minor == -1 or dot !=
'.')
383 throw InternalErr(__FILE__, __LINE__,
"Could not parse dap version. Value given: " + v);
394 switch (d_dap_major) {
396 d_namespace = c_dap20_namespace;
399 d_namespace = c_dap32_namespace;
402 d_namespace = c_dap40_namespace;
405 throw InternalErr(__FILE__, __LINE__,
"Unknown DAP version.");
419 int major = floor(d);
420 int minor = (d-major)*10;
422 DBG(cerr <<
"Major: " << major <<
", Minor: " << minor << endl);
425 oss << major <<
"." << minor;
442 return d_container_name;
470 d_container_name = cn;
498 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
501 w += (*i)->width(constrained);
504 w += (*i)->width(constrained);
524 uint64_t req_size = 0;
525 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
528 req_size += (*i)->width(constrained);
531 req_size += (*i)->width(constrained);
534 return req_size/1024;
545 throw InternalErr(__FILE__, __LINE__,
"Trying to add a BaseType object with a NULL pointer.");
547 DBG2(cerr <<
"In DDS::add_var(), bt's address is: " << bt << endl);
550 DBG2(cerr <<
"In DDS::add_var(), btp's address is: " << btp << endl);
570 throw InternalErr(__FILE__, __LINE__,
"Trying to add a BaseType object with a NULL pointer.");
572 DBG2(cerr <<
"In DDS::add_var(), bt's address is: " << bt << endl);
597 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
598 if ((*i)->name() == n) {
614 if (i != vars.end()) {
630 for (Vars_iter i_tmp = i1; i_tmp != i2; i_tmp++) {
674 return d_container->
var( name,
false, s ) ;
680 return leaf_match(name, s);
684DDS::leaf_match(
const string &n, BaseType::btp_stack *s)
686 DBG(cerr <<
"DDS::leaf_match: Looking for " << n << endl);
688 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
690 DBG(cerr <<
"DDS::leaf_match: Looking for " << n <<
" in: " << btp->name() << endl);
692 if (btp->name() == n) {
693 DBG(cerr <<
"Found " << n <<
" in: " << btp->name() << endl);
697 if (btp->is_constructor_type()) {
698 BaseType *found = btp->var(n,
false, s);
700 DBG(cerr <<
"Found " << n <<
" in: " << btp->name() << endl);
704#if STRUCTURE_ARRAY_SYNTAX_OLD
705 if (btp->is_vector_type() && btp->var()->is_constructor_type()) {
707 BaseType *found = btp->var()->var(n,
false, s);
709 DBG(cerr <<
"Found " << n <<
" in: " << btp->var()->d_name() << endl);
720DDS::exact_match(
const string &name, BaseType::btp_stack *s)
722 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
724 DBG2(cerr <<
"Looking for " << d_name <<
" in: " << btp << endl);
726 if (btp->name() == name) {
727 DBG2(cerr <<
"Found " << d_name <<
" in: " << btp << endl);
732 string::size_type dot_pos = name.find(
".");
733 if (dot_pos != string::npos) {
734 string aggregate = name.substr(0, dot_pos);
735 string field = name.substr(dot_pos + 1);
737 BaseType *agg_ptr =
var(aggregate, s);
739 DBG2(cerr <<
"Descending into " << agg_ptr->name() << endl);
740 return agg_ptr->var(field,
true, s);
782#if USE_LOCAL_TIMEOUT_SCHEME
792#if USE_LOCAL_TIMEOUT_SCHEME
813#if USE_LOCAL_TIMEOUT_SCHEME
822#if USE_LOCAL_TIMEOUT_SCHEME
833 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
834 if ((*i)->type() == dods_sequence_c)
836 else if ((*i)->type() == dods_structure_c)
845 FILE *in = fopen(fname.c_str(),
"r");
848 throw Error(cannot_read_file,
"Could not open: " + fname);
867 int new_fd = _dup(fd);
869 int new_fd = dup(fd);
873 throw InternalErr(__FILE__, __LINE__,
"Could not access file.");
874 FILE *in = fdopen(new_fd,
"r");
877 throw InternalErr(__FILE__, __LINE__,
"Could not access file.");
900 throw InternalErr(__FILE__, __LINE__,
"Null input stream.");
903 void *buffer = dds_buffer(in);
904 dds_switch_to_buffer(buffer);
908 bool status = ddsparse(&arg) == 0;
910 dds_delete_buffer(buffer);
912 DBG2(cout <<
"Status from parser: " << status << endl);
916 if (!status || !arg.status()) {
928 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
935 out <<
"Dataset {\n" ;
937 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
938 (*i)->print_decl(out) ;
941 out <<
"} " <<
id2www(d_name) <<
";\n" ;
956 for (AttrTable::Attr_iter i = a.attr_begin(), e = a.attr_end(); i != e; ++i) {
957 if (a.get_attr_type(i) != Attr_container) {
984 Grid* grid =
dynamic_cast<Grid*
>(btp);
989 for (Constructor::Vars_iter i = cons->var_begin(), e = cons->var_end(); i != e; i++) {
1006static string four_spaces =
" ";
1007void print_var_das(ostream &out, BaseType *bt,
string indent =
"") {
1012 AttrTable attr_table = bt->get_attr_table();
1015 Constructor *cnstrctr =
dynamic_cast<Constructor *
>(bt);
1017 Grid *grid =
dynamic_cast<Grid *
>(bt);
1019 Array *gridArray = grid->get_array();
1020 AttrTable arrayAT = gridArray->get_attr_table();
1023 gridArray->get_attr_table().print(out, indent + four_spaces);
1027 for (Grid::Map_iter mIter = grid->map_begin();
1028 mIter != grid->map_end(); ++mIter) {
1029 BaseType *currentMap = *mIter;
1031 print_var_das(out, currentMap, indent + four_spaces);
1036 attr_table.print(out, indent + four_spaces);
1037 Constructor::Vars_iter i = cnstrctr->var_begin();
1038 Constructor::Vars_iter e = cnstrctr->var_end();
1039 for (; i != e; i++) {
1045 print_var_das(out, *i, indent + four_spaces);
1050 attr_table.print(out, indent + four_spaces);
1053 out << indent <<
"}" << endl;
1067 unique_ptr<DAS> das(
get_das());
1095get_unique_top_level_global_container_name(
DAS *das)
1099 AttrTable *table = das->get_table(TOP_LEVEL_ATTRS_CONTAINER_NAME);
1101 return TOP_LEVEL_ATTRS_CONTAINER_NAME;
1110 if (!(i < UINT_MAX))
1111 throw InternalErr(__FILE__, __LINE__,
"Cannot add top-level attributes to the DAS");
1112 name = TOP_LEVEL_ATTRS_CONTAINER_NAME + oss.str();
1113 table = das->get_table(name);
1129 Grid *grid =
dynamic_cast<Grid *
>(bt);
1131 Array *gridArray = grid->get_array();
1134 for( AttrTable::Attr_iter atIter = arrayAT.attr_begin(); atIter!=arrayAT.attr_end(); ++atIter){
1135 AttrType type = arrayAT.get_attr_type(atIter);
1136 string childName = arrayAT.get_name(atIter);
1137 if (type == Attr_container){
1138 at->append_container(
new AttrTable(*arrayAT.get_attr_table(atIter)), childName);
1141 vector<string>* pAttrTokens = arrayAT.get_attr_vector(atIter);
1149 for (Constructor::Vars_iter i = cons->var_begin(), e = cons->var_end(); i != e; i++) {
1153 at->append_container(childAttrT,(*i)->name());
1162 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
1164 AttrTable *childAttrT =
new AttrTable((*i)->get_attr_table());
1166 das->add_table((*i)->name(), childAttrT);
1171 unique_ptr<AttrTable> global(
new AttrTable);
1186 if (global->get_size() > 0) {
1187 das->add_table(get_unique_top_level_global_container_name(das), global.get());
1207 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
1223 out <<
"Dataset {\n" ;
1225 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
1229 (*i)->print_decl(out,
" ",
true,
false,
true) ;
1232 out <<
"} " <<
id2www(d_name) <<
";\n" ;
1253 fwrite(oss.str().data(), 1, oss.str().length(), out);
1273class VariablePrintXMLWriter :
public unary_function<BaseType *, void>
1278 VariablePrintXMLWriter(
XMLWriter &xml,
bool constrained)
1279 : d_xml(xml), d_constrained(constrained)
1281 void operator()(BaseType *bt)
1283 bt->print_xml_writer(d_xml, d_constrained);
1310 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Dataset") < 0)
1311 throw InternalErr(__FILE__, __LINE__,
"Could not write Dataset element");
1312 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*)d_name.c_str()) < 0)
1313 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1314 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xsi", (
const xmlChar*)
"http://www.w3.org/2001/XMLSchema-instance") < 0)
1315 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xsi");
1317 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xsi:schemaLocation", (
const xmlChar*)c_dap_32_n_sl.c_str()) < 0)
1318 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:schemaLocation");
1320 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:grddl", (
const xmlChar*)
"http://www.w3.org/2003/g/data-view#") < 0)
1321 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:grddl");
1323 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"grddl:transformation", (
const xmlChar*)grddl_transformation_dap32.c_str()) < 0)
1324 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:transformation");
1326 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns", (
const xmlChar*)c_dap32_namespace.c_str()) < 0)
1327 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns");
1328 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:dap", (
const xmlChar*)c_dap32_namespace.c_str()) < 0)
1329 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:dap");
1331 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dapVersion", (
const xmlChar*)
"3.2") < 0)
1332 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1335 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xml", (
const xmlChar*)c_xml_namespace.c_str()) < 0)
1336 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xml");
1338 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xml:base", (
const xmlChar*)
get_request_xml_base().c_str()) < 0)
1339 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xml:base");
1346 for_each(
var_begin(),
var_end(), VariablePrintXMLWriter(xml, constrained));
1348 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"blob") < 0)
1349 throw InternalErr(__FILE__, __LINE__,
"Could not write blob element");
1350 string cid =
"cid:" + blob;
1351 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"href", (
const xmlChar*) cid.c_str()) < 0)
1352 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for d_name");
1353 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1354 throw InternalErr(__FILE__, __LINE__,
"Could not end blob element");
1356 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1357 throw InternalErr(__FILE__, __LINE__,
"Could not end Dataset element");
1359 out << xml.get_doc();
1379 throw InternalErr(__FILE__, __LINE__,
"Tried to print a DMR with DAP major version less than 4");
1384 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Group") < 0)
1385 throw InternalErr(__FILE__, __LINE__,
"Could not write Group element");
1387 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xml",
1388 (
const xmlChar*) c_xml_namespace.c_str()) < 0)
1389 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xml");
1391 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xsi", (
const xmlChar*) c_xml_xsi.c_str())
1393 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xsi");
1395 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xsi:schemaLocation",
1396 (
const xmlChar*) c_dap_40_n_sl.c_str()) < 0)
1397 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:schemaLocation");
1399 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns",
1401 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns");
1403 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dapVersion",
1404 (
const xmlChar*) get_dap_version().c_str()) < 0)
1405 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1407 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dmrVersion", (
const xmlChar*) get_dmr_version().c_str()) < 0)
1408 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1411 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xml:base",
1413 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xml:base");
1416 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*) d_name.c_str()) < 0)
1417 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1423 for_each(
var_begin(),
var_end(), VariablePrintXMLWriter(xml, constrained));
1425 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1426 throw InternalErr(__FILE__, __LINE__,
"Could not end the top-level Group element");
1428 out << xml.get_doc();
1451 cerr <<
"A dataset must have a d_name" << endl;
1456 if (!unique_names(vars, d_name,
"Dataset", msg))
1460 for (Vars_iter i = vars.begin(); i != vars.end(); i++)
1461 if (!(*i)->check_semantics(msg,
true))
1493 unique_ptr<BaseType::btp_stack> s(
new BaseType::btp_stack);
1495 DBG2(cerr <<
"DDS::mark: Looking for " << n << endl);
1499 throw Error(malformed_expr,
"Could not find variable " + n);
1502 variable->set_send_p(state);
1504 DBG2(cerr <<
"DDS::mark: Set variable " << variable->d_name()
1505 <<
" (a " << variable->type_name() <<
")" << endl);
1511 while (!s->empty()) {
1512 s->top()->BaseType::set_send_p(state);
1514 DBG2(cerr <<
"DDS::mark: Set variable " << s->top()->d_name()
1515 <<
" (a " << s->top()->type_name() <<
")" << endl);
1517 string parent_name = (s->top()->get_parent()) ? s->top()->get_parent()->name():
"none";
1518 string parent_type = (s->top()->get_parent()) ? s->top()->get_parent()->type_name():
"none";
1519 DBG2(cerr <<
"DDS::mark: Parent variable " << parent_name <<
" (a " << parent_type <<
")" << endl);
1535 for (Vars_iter i = vars.begin(); i != vars.end(); i++)
1536 (*i)->set_send_p(state);
1549 strm << DapIndent::LMarg <<
"DDS::dump - ("
1550 << (
void *)
this <<
")" << endl ;
1551 DapIndent::Indent() ;
1552 strm << DapIndent::LMarg <<
"d_name: " << d_name << endl ;
1553 strm << DapIndent::LMarg <<
"filename: " << d_filename << endl ;
1554 strm << DapIndent::LMarg <<
"protocol major: " << d_dap_major << endl;
1555 strm << DapIndent::LMarg <<
"protocol minor: " << d_dap_minor << endl;
1556 strm << DapIndent::LMarg <<
"factory: " << (
void *)d_factory << endl ;
1558 strm << DapIndent::LMarg <<
"global attributes:" << endl ;
1559 DapIndent::Indent() ;
1561 DapIndent::UnIndent() ;
1564 strm << DapIndent::LMarg <<
"vars:" << endl ;
1565 DapIndent::Indent() ;
1566 Vars_citer i = vars.begin() ;
1567 Vars_citer ie = vars.end() ;
1568 for (; i != ie; i++) {
1571 DapIndent::UnIndent() ;
1574 strm << DapIndent::LMarg <<
"vars: none" << endl ;
1577 DapIndent::UnIndent() ;
A multidimensional array of identical data types.
Contains the attributes for a dataset.
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
virtual Attr_iter attr_end()
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
virtual Attr_iter attr_begin()
virtual string get_name() const
Get the name of this attribute table.
void print_xml_writer(XMLWriter &xml)
virtual void dump(ostream &strm) const
dumps information about this object
The basic data type for the DODS DAP types.
virtual BaseType * ptr_duplicate()=0
BaseType * var(const string &name, bool exact_match=true, btp_stack *s=nullptr) override
btp_stack no longer needed; use back pointers (BaseType::get_parent())
void add_var(BaseType *bt, Part part=nil) override
void add_var_nocopy(BaseType *bt, Part part=nil) override
virtual void del_var(const string &name)
Remove an element from a Constructor.
Hold attribute data for a DAP2 dataset.
void set_dataset_name(const string &n)
void set_dap_major(int p)
void mark_all(bool state)
void print_dmr(ostream &out, bool constrained)
Print the DAP4 DMR object using a DDS.
void add_var_nocopy(BaseType *bt)
Adds the variable to the DDS.
bool check_semantics(bool all=false)
Check the semantics of each of the variables represented in the DDS.
virtual AttrTable & get_attr_table()
uint64_t get_request_size_kb(bool constrained)
Get the estimated response size in kilobytes.
virtual void transfer_attributes(DAS *das)
void set_dap_minor(int p)
string get_namespace() const
Get the namespace associated with the DDS - likely set only by DDX responses.
int num_var()
Returns the number of variables in the DDS.
void print(FILE *out)
Print the entire DDS to the specified file.
int get_request_size(bool constrained)
Get the estimated response size in bytes.
string get_dataset_name() const
void del_var(const string &n)
Removes a variable from the DDS.
void parse(string fname)
Parse a DDS from a file with the given d_name.
BaseType * var(const string &n, BaseType::btp_stack &s)
void print_xml(FILE *out, bool constrained, const string &blob="")
void insert_var(Vars_iter i, BaseType *ptr)
Insert a variable before the referenced element.
bool mark(const string &name, bool state)
Mark the send_p flag of the named variable to state.
DDS(BaseTypeFactory *factory, const string &name="")
void tag_nested_sequences()
Traverse DDS, set Sequence leaf nodes.
DAS * get_das()
Get a DAS object.
void print_constrained(FILE *out)
Print a constrained DDS to the specified file.
void insert_var_nocopy(Vars_iter i, BaseType *ptr)
string get_request_xml_base() const
Get the URL that will return this DDS/DDX/DataThing.
Vars_iter var_end()
Return an iterator.
int get_dap_major() const
Get the DAP major version as sent by the client.
void set_dap_version(const string &version_string="2.0")
void add_var(BaseType *bt)
Adds a copy of the variable to the DDS. Using the ptr_duplicate() method, perform a deep copy on the ...
void print_xml_writer(ostream &out, bool constrained, const string &blob="")
void print_das(ostream &out)
write the DAS response given the attribute information in the DDS
virtual void dump(ostream &strm) const
dumps information about this object
libdap base object for common functionality of libdap objects
A class for error processing.
Holds the Grid data type.
A class for software fault reporting.
virtual void set_leaf_sequence(int lvl=1)
Mark the Sequence which holds the leaf elements.
Holds a structure (aggregate) type.
virtual void set_leaf_sequence(int level=1)
Traverse Structure, set Sequence leaf nodes.
top level DAP object to house generic methods
bool has_dap2_attributes(AttrTable &a)
string www2id(const string &in, const string &escape, const string &except)
string add_space_encoding(const string &s)
string AttrType_to_String(const AttrType at)
void fillConstructorAttrTable(AttrTable *at, BaseType *bt)
Recursive helper function for Building DAS entries for Constructor types.
string id2www(string in, const string &allowable)
Pass parameters by reference to a parser.