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)
254 "Error transferring attributes: working on a container in dds, but not das");
260 (*i)->transfer_attributes(top);
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 (
auto &btp: vars) {
528 req_size += btp->width_ll(constrained);
531 req_size += btp->width_ll(constrained);
535 return req_size / 1024;
546 throw InternalErr(__FILE__, __LINE__,
"Trying to add a BaseType object with a NULL pointer.");
548 DBG2(cerr <<
"In DDS::add_var(), bt's address is: " << bt << endl);
551 DBG2(cerr <<
"In DDS::add_var(), btp's address is: " << btp << endl);
571 throw InternalErr(__FILE__, __LINE__,
"Trying to add a BaseType object with a NULL pointer.");
573 DBG2(cerr <<
"In DDS::add_var(), bt's address is: " << bt << endl);
598 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
599 if ((*i)->name() == n) {
615 if (i != vars.end()) {
631 for (Vars_iter i_tmp = i1; i_tmp != i2; i_tmp++) {
675 return d_container->
var( name,
false, s ) ;
681 return leaf_match(name, s);
685DDS::leaf_match(
const string &n, BaseType::btp_stack *s)
687 DBG(cerr <<
"DDS::leaf_match: Looking for " << n << endl);
689 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
691 DBG(cerr <<
"DDS::leaf_match: Looking for " << n <<
" in: " << btp->
name() << endl);
693 if (btp->
name() == n) {
694 DBG(cerr <<
"Found " << n <<
" in: " << btp->
name() << endl);
699 BaseType *found = btp->
var(n,
false, s);
701 DBG(cerr <<
"Found " << n <<
" in: " << btp->
name() << endl);
705#if STRUCTURE_ARRAY_SYNTAX_OLD
708 BaseType *found = btp->
var()->
var(n,
false, s);
710 DBG(cerr <<
"Found " << n <<
" in: " << btp->
var()->d_name() << endl);
721DDS::exact_match(
const string &name, BaseType::btp_stack *s)
723 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
725 DBG2(cerr <<
"Looking for " << d_name <<
" in: " << btp << endl);
727 if (btp->name() == name) {
728 DBG2(cerr <<
"Found " << d_name <<
" in: " << btp << endl);
733 string::size_type dot_pos = name.find(
".");
734 if (dot_pos != string::npos) {
735 string aggregate = name.substr(0, dot_pos);
736 string field = name.substr(dot_pos + 1);
738 BaseType *agg_ptr =
var(aggregate, s);
740 DBG2(cerr <<
"Descending into " << agg_ptr->name() << endl);
741 return agg_ptr->var(field,
true, s);
783#if USE_LOCAL_TIMEOUT_SCHEME
793#if USE_LOCAL_TIMEOUT_SCHEME
814#if USE_LOCAL_TIMEOUT_SCHEME
823#if USE_LOCAL_TIMEOUT_SCHEME
834 for (Vars_iter i = vars.begin(); i != vars.end(); i++) {
835 if ((*i)->type() == dods_sequence_c)
837 else if ((*i)->type() == dods_structure_c)
846 FILE *in = fopen(fname.c_str(),
"r");
849 throw Error(cannot_read_file,
"Could not open: " + fname);
868 int new_fd = _dup(fd);
870 int new_fd = dup(fd);
874 throw InternalErr(__FILE__, __LINE__,
"Could not access file.");
875 FILE *in = fdopen(new_fd,
"r");
878 throw InternalErr(__FILE__, __LINE__,
"Could not access file.");
901 throw InternalErr(__FILE__, __LINE__,
"Null input stream.");
904 void *buffer = dds_buffer(in);
905 dds_switch_to_buffer(buffer);
909 bool status = ddsparse(&arg) == 0;
911 dds_delete_buffer(buffer);
913 DBG2(cout <<
"Status from parser: " << status << endl);
917 if (!status || !arg.status()) {
929 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
936 out <<
"Dataset {\n" ;
938 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
939 (*i)->print_decl(out) ;
942 out <<
"} " <<
id2www(d_name) <<
";\n" ;
985 Grid* grid =
dynamic_cast<Grid*
>(btp);
990 for (Constructor::Vars_iter i = cons->
var_begin(), e = cons->
var_end(); i != e; i++) {
1007static string four_spaces =
" ";
1008void print_var_das(ostream &out, BaseType *bt,
string indent =
"") {
1013 AttrTable attr_table = bt->get_attr_table();
1016 Constructor *cnstrctr =
dynamic_cast<Constructor *
>(bt);
1018 Grid *grid =
dynamic_cast<Grid *
>(bt);
1020 Array *gridArray = grid->get_array();
1021 AttrTable arrayAT = gridArray->get_attr_table();
1024 gridArray->get_attr_table().print(out, indent + four_spaces);
1028 for (Grid::Map_iter mIter = grid->map_begin();
1029 mIter != grid->map_end(); ++mIter) {
1030 BaseType *currentMap = *mIter;
1032 print_var_das(out, currentMap, indent + four_spaces);
1037 attr_table.print(out, indent + four_spaces);
1038 Constructor::Vars_iter i = cnstrctr->var_begin();
1039 Constructor::Vars_iter e = cnstrctr->var_end();
1040 for (; i != e; i++) {
1046 print_var_das(out, *i, indent + four_spaces);
1051 attr_table.print(out, indent + four_spaces);
1054 out << indent <<
"}" << endl;
1068 unique_ptr<DAS> das(
get_das());
1096get_unique_top_level_global_container_name(
DAS *das)
1102 return TOP_LEVEL_ATTRS_CONTAINER_NAME;
1111 if (!(i < UINT_MAX))
1112 throw InternalErr(__FILE__, __LINE__,
"Cannot add top-level attributes to the DAS");
1113 name = TOP_LEVEL_ATTRS_CONTAINER_NAME + oss.str();
1130 Grid *grid =
dynamic_cast<Grid *
>(bt);
1135 for( AttrTable::Attr_iter atIter = arrayAT.
attr_begin(); atIter!=arrayAT.
attr_end(); ++atIter){
1137 string childName = arrayAT.
get_name(atIter);
1138 if (type == Attr_container){
1150 for (Constructor::Vars_iter i = cons->
var_begin(), e = cons->
var_end(); i != e; i++) {
1163 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
1165 AttrTable *childAttrT =
new AttrTable((*i)->get_attr_table());
1167 das->add_table((*i)->name(), childAttrT);
1172 unique_ptr<AttrTable> global(
new AttrTable);
1187 if (global->get_size() > 0) {
1188 das->add_table(get_unique_top_level_global_container_name(das), global.get());
1208 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
1224 out <<
"Dataset {\n" ;
1226 for (Vars_citer i = vars.begin(); i != vars.end(); i++) {
1230 (*i)->print_decl(out,
" ",
true,
false,
true) ;
1233 out <<
"} " <<
id2www(d_name) <<
";\n" ;
1254 fwrite(oss.str().data(), 1, oss.str().length(), out);
1274class VariablePrintXMLWriter :
public unary_function<BaseType *, void>
1279 VariablePrintXMLWriter(
XMLWriter &xml,
bool constrained)
1280 : d_xml(xml), d_constrained(constrained)
1282 void operator()(BaseType *bt)
1284 bt->print_xml_writer(d_xml, d_constrained);
1311 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Dataset") < 0)
1312 throw InternalErr(__FILE__, __LINE__,
"Could not write Dataset element");
1313 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*)d_name.c_str()) < 0)
1314 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1315 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xsi", (
const xmlChar*)
"http://www.w3.org/2001/XMLSchema-instance") < 0)
1316 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xsi");
1318 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xsi:schemaLocation", (
const xmlChar*)c_dap_32_n_sl.c_str()) < 0)
1319 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:schemaLocation");
1321 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:grddl", (
const xmlChar*)
"http://www.w3.org/2003/g/data-view#") < 0)
1322 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:grddl");
1324 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"grddl:transformation", (
const xmlChar*)grddl_transformation_dap32.c_str()) < 0)
1325 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:transformation");
1327 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns", (
const xmlChar*)c_dap32_namespace.c_str()) < 0)
1328 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns");
1329 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:dap", (
const xmlChar*)c_dap32_namespace.c_str()) < 0)
1330 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:dap");
1332 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dapVersion", (
const xmlChar*)
"3.2") < 0)
1333 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1336 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xml", (
const xmlChar*)c_xml_namespace.c_str()) < 0)
1337 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xml");
1339 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xml:base", (
const xmlChar*)
get_request_xml_base().c_str()) < 0)
1340 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xml:base");
1347 for_each(
var_begin(),
var_end(), VariablePrintXMLWriter(xml, constrained));
1349 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"blob") < 0)
1350 throw InternalErr(__FILE__, __LINE__,
"Could not write blob element");
1351 string cid =
"cid:" + blob;
1352 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"href", (
const xmlChar*) cid.c_str()) < 0)
1353 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for d_name");
1354 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1355 throw InternalErr(__FILE__, __LINE__,
"Could not end blob element");
1357 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1358 throw InternalErr(__FILE__, __LINE__,
"Could not end Dataset element");
1360 out << xml.get_doc();
1380 throw InternalErr(__FILE__, __LINE__,
"Tried to print a DMR with DAP major version less than 4");
1385 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Group") < 0)
1386 throw InternalErr(__FILE__, __LINE__,
"Could not write Group element");
1388 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xml",
1389 (
const xmlChar*) c_xml_namespace.c_str()) < 0)
1390 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xml");
1392 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns:xsi", (
const xmlChar*) c_xml_xsi.c_str())
1394 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:xsi");
1396 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xsi:schemaLocation",
1397 (
const xmlChar*) c_dap_40_n_sl.c_str()) < 0)
1398 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:schemaLocation");
1400 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns",
1402 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns");
1404 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dapVersion",
1405 (
const xmlChar*) get_dap_version().c_str()) < 0)
1406 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1408 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dmrVersion", (
const xmlChar*) get_dmr_version().c_str()) < 0)
1409 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
1412 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xml:base",
1414 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xml:base");
1417 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*) d_name.c_str()) < 0)
1418 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1424 for_each(
var_begin(),
var_end(), VariablePrintXMLWriter(xml, constrained));
1426 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1427 throw InternalErr(__FILE__, __LINE__,
"Could not end the top-level Group element");
1429 out << xml.get_doc();
1452 cerr <<
"A dataset must have a d_name" << endl;
1457 if (!unique_names(vars, d_name,
"Dataset", msg))
1461 for (Vars_iter i = vars.begin(); i != vars.end(); i++)
1462 if (!(*i)->check_semantics(msg,
true))
1494 unique_ptr<BaseType::btp_stack> s(
new BaseType::btp_stack);
1496 DBG2(cerr <<
"DDS::mark: Looking for " << n << endl);
1500 throw Error(malformed_expr,
"Could not find variable " + n);
1505 DBG2(cerr <<
"DDS::mark: Set variable " << variable->d_name()
1506 <<
" (a " << variable->
type_name() <<
")" << endl);
1512 while (!s->empty()) {
1513 s->top()->BaseType::set_send_p(state);
1515 DBG2(cerr <<
"DDS::mark: Set variable " << s->top()->d_name()
1516 <<
" (a " << s->top()->type_name() <<
")" << endl);
1518 string parent_name = (s->top()->get_parent()) ? s->top()->get_parent()->name():
"none";
1519 string parent_type = (s->top()->get_parent()) ? s->top()->get_parent()->type_name():
"none";
1520 DBG2(cerr <<
"DDS::mark: Parent variable " << parent_name <<
" (a " << parent_type <<
")" << endl);
1536 for (Vars_iter i = vars.begin(); i != vars.end(); i++)
1537 (*i)->set_send_p(state);
1565 strm << DapIndent::LMarg <<
"DDS::dump - ("
1566 << (
void *)
this <<
")" << endl ;
1567 DapIndent::Indent() ;
1568 strm << DapIndent::LMarg <<
"d_name: " << d_name << endl ;
1569 strm << DapIndent::LMarg <<
"filename: " << d_filename << endl ;
1570 strm << DapIndent::LMarg <<
"protocol major: " << d_dap_major << endl;
1571 strm << DapIndent::LMarg <<
"protocol minor: " << d_dap_minor << endl;
1572 strm << DapIndent::LMarg <<
"factory: " << (
void *)d_factory << endl ;
1574 strm << DapIndent::LMarg <<
"global attributes:" << endl ;
1575 DapIndent::Indent() ;
1577 DapIndent::UnIndent() ;
1580 strm << DapIndent::LMarg <<
"vars:" << endl ;
1581 DapIndent::Indent() ;
1582 Vars_citer i = vars.begin() ;
1583 Vars_citer ie = vars.end() ;
1584 for (; i != ie; i++) {
1587 DapIndent::UnIndent() ;
1590 strm << DapIndent::LMarg <<
"vars: none" << endl ;
1593 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.
bool has_dap4_types(const std::string &path, std::vector< std::string > &inventory) const
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 unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
virtual Attr_iter attr_begin()
virtual string get_name() const
Get the name of this attribute table.
void print_xml_writer(XMLWriter &xml)
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
virtual void dump(ostream &strm) const
dumps information about this object
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
The basic data type for the DODS DAP types.
virtual bool is_dap4_projected(std::vector< string > &projected_dap4_inventory)
virtual string type_name() const
Returns the type of the class instance as a string.
virtual AttrTable & get_attr_table()
virtual string name() const
Returns the name of the class instance.
virtual bool is_vector_type() const
Returns true if the instance is a vector (i.e., array) type variable.
virtual bool is_constructor_type() const
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
virtual void set_send_p(bool state)
virtual BaseType * ptr_duplicate()=0
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=nullptr)
Returns a pointer to a member of a constructor class.
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
unsigned int width(bool constrained=false) const override
virtual void del_var(const string &name)
Remove an element from a Constructor.
Hold attribute data for a DAP2 dataset.
virtual AttrTable * get_top_level_attributes()
Returns the top most set of attributes.
AttrTable * get_table(AttrTable::Attr_iter &i)
Returns the referenced variable attribute table.
virtual string container_name() const
Returns the name of the current attribute container when multiple files used to build this DAS.
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.
bool is_dap4_projected(std::vector< string > &inventory)
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.
const vector< BaseType * > & variables() const
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.
Array * get_array()
Returns the Grid Array. This method returns the array using an Array*, so no cast is required.
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.