libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
Constructor.cc
Go to the documentation of this file.
1
2// -*- mode: c++; c-basic-offset:4 -*-
3
4// This file is part of libdap, A C++ implementation of the OPeNDAP Data
5// Access Protocol.
6
7// Copyright (c) 2002,2003 OPeNDAP, Inc.
8// Author: James Gallagher <jgallagher@opendap.org>
9//
10// This library is free software; you can redistribute it and/or
11// modify it under the terms of the GNU Lesser General Public
12// License as published by the Free Software Foundation; either
13// version 2.1 of the License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26// (c) COPYRIGHT URI/MIT 1995-1999
27// Please read the full copyright statement in the file COPYRIGHT_URI.
28//
29// Authors:
30// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31
32#include "config.h"
33
34#include <algorithm>
35#include <cstdint>
36#include <sstream>
37#include <string>
38
39#include "crc.h"
40
41#include "Constructor.h"
42#include "Grid.h"
43
44#include "D4Group.h"
45#include "D4StreamMarshaller.h"
47#include "DMR.h"
48#include "XMLWriter.h"
49
50#include "D4Attributes.h"
51
52#include "DapIndent.h"
53#include "InternalErr.h"
54#include "escaping.h"
55#include "util.h"
56
57#include "debug.h"
58
59using namespace std;
60
61namespace libdap {
62
63// Private member functions
64
65void Constructor::m_duplicate(const Constructor &c) {
66 // Clear out any spurious vars in Constructor::d_vars
67 // Moved from Grid::m_duplicate. jhrg 4/3/13
68 d_vars.clear(); // [mjohnson 10 Sep 2009]
69
70 for (auto var : c.d_vars) {
71 BaseType *btp = var->ptr_duplicate();
72 btp->set_parent(this);
73 d_vars.push_back(btp);
74 }
75}
76
77// Public member functions
78
79// A public method, but just barely...
80// TODO Understand what this method does. What is dest? Is it the parent-to-be
81// of the variables in this Constructor? jhrg 4/25/22
83 for (Constructor::Vars_citer i = var_begin(), e = var_end(); i != e; ++i) {
84
85 BaseType *d4_var = dest->var((*i)->name());
86 // Don't add duplicate variables. We have to make this check
87 // because some child variables may add arrays
88 // to the root object. For example, this happens in
89 // Grid with the Map Arrays - ndp - 05/08/17
90 if (!d4_var) {
91 (*i)->transform_to_dap4(root /*group*/, dest /*container*/);
92 }
93 }
95 dest->set_is_dap4(true);
96}
97
98string Constructor::FQN() const {
99 if (get_parent() == 0)
100 return name();
101 else if (get_parent()->type() == dods_group_c)
102 return get_parent()->FQN() + name();
103 else if (get_parent()->type() == dods_array_c)
104 return get_parent()->FQN();
105 else
106 return get_parent()->FQN() + "." + name();
107}
108
110 if (!leaves)
111 return d_vars.size();
112 else {
113 int i = 0;
114 for (auto var : d_vars) {
115 i += var->element_count(leaves);
116 }
117 return i;
118 }
119}
120
121void Constructor::set_send_p(bool state) {
122 for (auto var : d_vars) {
123 var->set_send_p(state);
124 }
125
127}
128
140void Constructor::set_read_p(bool state) {
141 for (auto var : d_vars) {
142 var->set_read_p(state);
143 }
144
146}
147
156unsigned int Constructor::width(bool constrained) const {
157 unsigned int sz = 0;
158
159 for (auto var : d_vars) {
160 if (constrained) {
161 if (var->send_p())
162 sz += var->width(constrained);
163 } else {
164 sz += var->width(constrained);
165 }
166 }
167
168 return sz;
169}
170
176int64_t Constructor::width_ll(bool constrained) const {
177 int64_t sz = 0;
178
179 for (auto var : d_vars) {
180 if (constrained) {
181 if (var->send_p())
182 sz += var->width_ll(constrained);
183 } else {
184 sz += var->width_ll(constrained);
185 }
186 }
187
188 return sz;
189}
190
191BaseType *Constructor::var(const string &name, bool exact_match, btp_stack *s) {
192 string n = www2id(name);
193
194 if (exact_match)
195 return m_exact_match(n, s);
196 else
197 return m_leaf_match(n, s);
198}
199
201BaseType *Constructor::var(const string &n, btp_stack &s) {
202 // This should probably be removed. The BES code should remove web encoding
203 // with the possible exception of spaces. jhrg 11/25/13
204 string name = www2id(n);
205
206 BaseType *btp = m_exact_match(name, &s);
207 if (btp)
208 return btp;
209
210 return m_leaf_match(name, &s);
211}
212
213// Protected method
215 for (auto var : d_vars) {
216 if (var->name() == name) {
217 if (s) {
218 s->push(static_cast<BaseType *>(this));
219 }
220 return var;
221 }
222 if (var->is_constructor_type()) {
223 BaseType *btp = var->var(name, false, s);
224 if (btp) {
225 if (s) {
226 s->push(static_cast<BaseType *>(this));
227 }
228 return btp;
229 }
230 }
231 }
232
233 return nullptr;
234}
235
236// Protected method
238 // Look for name at the top level first.
239 for (auto var : d_vars) {
240 if (var->name() == name) {
241 if (s)
242 s->push(static_cast<BaseType *>(this));
243
244 return var;
245 }
246 }
247
248 // If it was not found using the simple search, look for a dot and
249 // search the hierarchy.
250 string::size_type dot_pos = name.find("."); // zero-based index of `.'
251 if (dot_pos != string::npos) {
252 string aggregate = name.substr(0, dot_pos);
253 string field = name.substr(dot_pos + 1);
254
255 BaseType *agg_ptr = var(aggregate);
256 if (agg_ptr) {
257 if (s)
258 s->push(static_cast<BaseType *>(this));
259
260 return agg_ptr->var(field, true, s); // recurse
261 } else
262 return nullptr; // qualified names must be *fully* qualified
263 }
264
265 return nullptr;
266}
267
270
274
277
281
286
290BaseType *Constructor::get_var_index(int i) { return *(d_vars.begin() + i); }
291
300
302
303 if (!bt)
304 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
305
306 if (i < 0 || i >= (int)(d_vars.size()))
307 throw InternalErr(__FILE__, __LINE__, "The index must be within the variable vector range..");
308
309 bt->set_parent(this);
310
311 // Update the is_dap4 property
312 if (bt->is_dap4())
313 set_is_dap4(true);
314
315 d_vars[i] = bt;
316}
317
323 // Jose Garcia
324 // Passing and invalid pointer to an object is a developer's error.
325 if (!bt)
326 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
327
328 // Jose Garcia
329 // Now we add a copy of bt so the external user is able to destroy bt as
330 // he/she wishes. The policy is: "If it is allocated outside, it is
331 // deallocated outside, if it is allocated inside, it is deallocated
332 // inside"
334}
335
341 if (!bt)
342 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
343
344 bt->set_parent(this);
345 d_vars.push_back(bt);
346
347 // Update the is_dap4 property
348 if (bt->is_dap4())
349 set_is_dap4(true);
350}
351
359void Constructor::del_var(const string &n) {
360 auto to_remove = stable_partition(d_vars.begin(), d_vars.end(), [n](BaseType *btp) { return btp->name() != n; });
361 for_each(to_remove, d_vars.end(), [](BaseType *btp) { delete btp; });
362 d_vars.erase(to_remove, d_vars.end());
363}
364
371 delete *i;
372 d_vars.erase(i);
373}
374
387 if (!read_p()) {
388 for (auto var : d_vars) {
389 if (var->send_p())
390 var->read();
391 }
392 // Set read_p for the Constructor
394 }
395
396 return false;
397}
398
400 if (is_dap4())
401 throw Error(string("A method usable only with DAP2 variables was called on a DAP4 variable (")
402 .append(name())
403 .append(")."),
404 __FILE__, __LINE__);
405
406 if (!read_p())
407 read(); // read() throws Error and InternalErr
408
409 for (auto var : d_vars) {
410 if (var->send_p()) {
411 var->intern_data(eval, dds);
412 }
413 }
414}
415
416bool Constructor::serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval) {
417 if (!read_p())
418 read(); // read() throws Error and InternalErr
419
420 if (ce_eval && !eval.eval_selection(dds, dataset()))
421 return true;
422
423 for (auto var : d_vars) {
424 if (var->send_p()) {
425#ifdef CHECKSUMS
426 XDRStreamMarshaller *sm = dynamic_cast<XDRStreamMarshaller *>(&m);
427 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
428 sm->reset_checksum();
429
430 var->serialize(eval, dds, m, false);
431
432 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
433 sm->get_checksum();
434#else
435 // (*i)->serialize(eval, dds, m, false);
436 // Only Sequence and Vector run the evaluator.
437 var->serialize(eval, dds, m, true);
438#endif
439 }
440 }
441
442 return true;
443}
444
445bool Constructor::deserialize(UnMarshaller &um, DDS *dds, bool reuse) {
446 for (auto var : d_vars) {
447 var->deserialize(um, dds, reuse);
448 }
449
450 return false;
451}
452
454 throw InternalErr(__FILE__, __LINE__, "Computing a checksum alone is not supported for Constructor types.");
455}
456
458 if (!read_p())
459 read(); // read() throws Error
460
461 for (auto var : d_vars) {
462 if (var->send_p()) {
463 var->intern_data(/*checksum, dmr, eval*/);
464 }
465 }
466}
467
479void Constructor::serialize(D4StreamMarshaller &m, DMR &dmr, bool filter) {
480 // Not used for the same reason the equivalent code in D4Group::serialize()
481 // is not used. Fail for D4Sequence and general issues with memory use.
482 //
483 // Revisit this - I had to uncomment this to get the netcdf_handler code
484 // to work - it relies on having NCStructure::read() called. The D4Sequence
485 // ::serialize() method calls read_next_instance(). What seems to be happening
486 // is that this call to read gets the first set of values, but does not store
487 // them; the call to serialize then runs the D4Sequence::serialize() method that
488 // _does_ read all the sequence data and then serialize it. However, the first
489 // sequence instance is missing...
490 if (!read_p())
491 read(); // read() throws Error
492
493 for (auto var : d_vars) {
494 if (var->send_p()) {
495 var->serialize(m, dmr, filter);
496 }
497 }
498}
499
501 for (auto var : d_vars) {
502 var->deserialize(um, dmr);
503 }
504}
505
506void Constructor::print_decl(FILE *out, string space, bool print_semi, bool constraint_info, bool constrained) {
507 ostringstream oss;
508 print_decl(oss, space, print_semi, constraint_info, constrained);
509 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
510}
511
512void Constructor::print_decl(ostream &out, string space, bool print_semi, bool constraint_info, bool constrained) {
513 if (constrained && !send_p())
514 return;
515
516 out << space << type_name() << " {\n";
517 for (auto var : d_vars) {
518 var->print_decl(out, space + " ", true, constraint_info, constrained);
519 }
520 out << space << "} " << id2www(name());
521
522 if (constraint_info) { // Used by test drivers only.
523 if (send_p())
524 out << ": Send True";
525 else
526 out << ": Send False";
527 }
528
529 if (print_semi)
530 out << ";\n";
531}
532
533void Constructor::print_val(FILE *out, string space, bool print_decl_p) {
534 ostringstream oss;
535 print_val(oss, space, print_decl_p);
536 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
537}
538
539void Constructor::print_val(ostream &out, string space, bool print_decl_p) {
540 if (print_decl_p) {
541 print_decl(out, space, false);
542 out << " = ";
543 }
544
545 out << "{ ";
546 for (Vars_citer i = d_vars.begin(), e = d_vars.end(); i != e; i++, (void)(i != e && out << ", ")) {
547 (*i)->print_val(out, "", false);
548 }
549
550 out << " }";
551
552 if (print_decl_p)
553 out << ";\n";
554}
555
559void Constructor::print_xml(FILE *out, string space, bool constrained) {
560 XMLWriter xml(space);
561 print_xml_writer(xml, constrained);
562 fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
563}
564
568void Constructor::print_xml(ostream &out, string space, bool constrained) {
569 XMLWriter xml(space);
570 print_xml_writer(xml, constrained);
571 out << xml.get_doc();
572}
573
574void Constructor::print_xml_writer(XMLWriter &xml, bool constrained) {
575 if (constrained && !send_p())
576 return;
577
578 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar *)type_name().c_str()) < 0)
579 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
580
581 if (!name().empty())
582 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar *)"name", (const xmlChar *)name().c_str()) < 0)
583 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
584
585 // DAP2 prints attributes first. For some reason we decided that DAP4 should
586 // print them second. No idea why... jhrg 8/15/14
587 if (!is_dap4() && get_attr_table().get_size() > 0)
589
590 if (!d_vars.empty())
591 for_each(d_vars.begin(), d_vars.end(),
592 [&xml, constrained](BaseType *btp) { btp->print_xml_writer(xml, constrained); });
593
594 if (is_dap4())
595 attributes()->print_dap4(xml);
596
597 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
598 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
599}
600
601void Constructor::print_dap4(XMLWriter &xml, bool constrained) {
602 if (constrained && !send_p())
603 return;
604
605 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar *)type_name().c_str()) < 0)
606 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
607
608 if (!name().empty())
609 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar *)"name", (const xmlChar *)name().c_str()) < 0)
610 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
611
612 if (!d_vars.empty())
613 for_each(d_vars.begin(), d_vars.end(),
614 [&xml, constrained](BaseType *btp) { btp->print_dap4(xml, constrained); });
615
616 attributes()->print_dap4(xml);
617
618 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
619 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
620}
621
622bool Constructor::check_semantics(string &msg, bool all) {
624 return false;
625
626 if (!unique_names(d_vars, name(), type_name(), msg))
627 return false;
628
629 if (all) {
630 for (auto var : d_vars) {
631 if (!var->check_semantics(msg, true)) {
632 return false;
633 }
634 }
635 }
636
637 return true;
638}
639
649bool Constructor::is_linear() { return false; }
650
657 for (auto var : d_vars) {
658 var->set_in_selection(state);
659 }
660
662}
663
665 AttrTable *at = at_container->get_attr_table(name());
666
667 if (at) {
668 BaseType::transfer_attributes(at_container);
669 for (auto var : d_vars) {
670 var->transfer_attributes(at);
671 }
672 }
673}
674
675AttrTable *Constructor::make_dropped_vars_attr_table(vector<BaseType *> *dropped_vars) {
676 AttrTable *dv_table = nullptr;
677 if (!dropped_vars->empty()) {
678 dv_table = new AttrTable;
679 dv_table->set_name("dap4:dropped_members");
680
681 vector<BaseType *>::iterator dvIter = dropped_vars->begin();
682 vector<BaseType *>::iterator dvEnd = dropped_vars->end();
683 unsigned int i = 0;
684 for (; dvIter != dvEnd; dvIter++, i++) {
685 BaseType *bt = (*dvIter);
686
687 AttrTable *bt_attr_table = new AttrTable(bt->get_attr_table());
688 bt_attr_table->set_name(bt->name());
689 string type_name = bt->type_name();
690
691 if (bt->is_vector_type()) {
692 Array *array = dynamic_cast<Array *>(bt);
693 if (array) { // This is always true - only an Array is_vector_type(). jhrg 4/25/22
694 type_name = array->prototype()->type_name();
695 Array::Dim_iter d_iter = array->dim_begin();
696 Array::Dim_iter end = array->dim_end();
697 for (; d_iter < end; d_iter++) {
698
699 ostringstream dim_size;
700 dim_size << (*d_iter).size;
701 bt_attr_table->append_attr("array_dimensions", AttrType_to_String(Attr_uint32), dim_size.str());
702 }
703 }
704 }
705
706 bt_attr_table->append_attr("dap4:type", "String", type_name);
707 dv_table->append_container(bt_attr_table, bt_attr_table->get_name());
708 // Clear entry now that we're done.
709 (*dvIter) = 0;
710 }
711 }
712
713 return dv_table;
714}
715
722bool Constructor::is_dap4_projected(std::vector<std::string> &inventory) {
723 bool has_projected_dap4 = false;
724 if (send_p()) {
725 has_projected_dap4 = attributes()->has_dap4_types(FQN(), inventory);
726 for (const auto var : variables()) {
727 has_projected_dap4 |= var->is_dap4_projected(inventory);
728 }
729 }
730 return has_projected_dap4;
731}
732
741void Constructor::dump(ostream &strm) const {
742 strm << DapIndent::LMarg << "Constructor::dump - (" << (void *)this << ")" << endl;
744 BaseType::dump(strm);
745 strm << DapIndent::LMarg << "vars: " << endl;
747
748 for (auto var : d_vars) {
749 var->dump(strm);
750 }
751
754}
755
756} // namespace libdap
Definition crc.h:43
A multidimensional array of identical data types.
Definition Array.h:121
std::vector< dimension >::iterator Dim_iter
Definition Array.h:225
Contains the attributes for a dataset.
Definition AttrTable.h:150
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition AttrTable.cc:517
virtual void set_name(const string &n)
Set the name of this attribute table.
Definition AttrTable.cc:247
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Definition AttrTable.cc:699
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition AttrTable.cc:308
virtual string get_name() const
Get the name of this attribute table.
Definition AttrTable.cc:243
void print_xml_writer(XMLWriter &xml)
virtual string type_name() const
Returns the type of the class instance as a string.
Definition BaseType.cc:335
virtual AttrTable & get_attr_table()
Definition BaseType.cc:498
virtual string name() const
Returns the name of the class instance.
Definition BaseType.cc:296
virtual void set_in_selection(bool state)
Definition BaseType.cc:611
virtual BaseType * get_parent() const
Definition BaseType.cc:636
virtual bool read_p()
Has this variable been read?
Definition BaseType.cc:410
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition BaseType.cc:442
virtual string dataset() const
Returns the name of the dataset used to create this instance.
Definition BaseType.cc:326
virtual void set_parent(BaseType *parent)
Definition BaseType.cc:622
void dump(ostream &strm) const override
dumps information about this object
Definition BaseType.cc:269
virtual bool is_vector_type() const
Returns true if the instance is a vector (i.e., array) type variable.
Definition BaseType.cc:352
virtual bool is_dap4() const
Definition BaseType.h:181
virtual D4Attributes * attributes()
Definition BaseType.cc:507
virtual std::string FQN() const
Definition BaseType.cc:304
virtual bool send_p()
Should this variable be sent?
Definition BaseType.cc:478
virtual void set_send_p(bool state)
Definition BaseType.cc:488
virtual void set_is_dap4(const bool v)
Definition BaseType.h:182
virtual BaseType * ptr_duplicate()=0
virtual void transfer_attributes(AttrTable *at)
Definition BaseType.cc:544
stack< BaseType * > btp_stack
Definition BaseType.h:149
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition BaseType.cc:1056
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Definition BaseType.cc:124
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=nullptr)
Returns a pointer to a member of a constructor class.
Definition BaseType.cc:646
virtual Type type() const
Returns the type of the class instance.
Definition BaseType.cc:329
Evaluate a constraint expression.
bool eval_selection(DDS &dds, const std::string &dataset)
Evaluate a boolean-valued constraint expression. This is main method for the evaluator and is called ...
std::vector< BaseType * >::reverse_iterator Vars_riter
Definition Constructor.h:61
int element_count(bool leaves=false) override
Count the members of constructor types.
void compute_checksum(Crc32 &checksum) override
include the data for this variable in the checksum DAP4 includes a checksum with every data response....
void transform_to_dap4(D4Group *root, Constructor *dest) override
DAP2 to DAP4 transform.
Vars_iter get_vars_iter(int i)
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 set_var_index(BaseType *bt, int i)
Set the ith element of d_vars to a variable object.
void add_var(BaseType *bt, Part part=nil) override
void transfer_attributes(AttrTable *at) override
void print_xml_writer(XMLWriter &xml, bool constrained=false) override
std::vector< BaseType * >::const_iterator Vars_citer
Definition Constructor.h:59
void print_decl(ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false) override
Print an ASCII representation of the variable structure.
void print_xml(ostream &out, string space=" ", bool constrained=false) override
bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false) override
Receive data from the net.
void intern_data() override
Read data into this variable.
void set_read_p(bool state) override
Set the 'read_p' property for the Constructor and its members.
void print_val(FILE *out, string space="", bool print_decl_p=true) override
Prints the value of the variable.
static AttrTable * make_dropped_vars_attr_table(vector< BaseType * > *dropped_vars)
std::vector< BaseType * >::iterator Vars_iter
Definition Constructor.h:60
std::vector< BaseType * > d_vars
Definition Constructor.h:47
void set_send_p(bool state) override
bool is_dap4_projected(std::vector< std::string > &inventory) override
bool read() override
Read the elements of Constructor marked for transmission.
void set_in_selection(bool state) override
Set the in_selection property.
bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true) override
Move data to the net, then remove them from the object.
Vars_riter var_rbegin()
BaseType * m_exact_match(const string &name, btp_stack *s=nullptr)
void add_var_nocopy(BaseType *bt, Part part=nil) override
const vector< BaseType * > & variables() const
unsigned int width(bool constrained=false) const override
BaseType * get_var_index(int i)
BaseType * m_leaf_match(const string &name, btp_stack *s=nullptr)
bool check_semantics(string &msg, bool all=false) override
Compare an object's current state with the semantics of its type.
Vars_iter var_begin()
void print_dap4(XMLWriter &xml, bool constrained=false) override
std::string FQN() const override
Vars_riter var_rend()
virtual bool is_linear()
Check to see whether this variable can be printed simply.
Constructor(const string &name, const Type &type, bool is_dap4=false)
Definition Constructor.h:52
virtual void del_var(const string &name)
Remove an element from a Constructor.
void dump(ostream &strm) const override
dumps information about this object
int64_t width_ll(bool constrained=false) const override
Get the width of the Constructor's fields.
void transform_to_dap4(AttrTable &at)
copy attributes from DAP2 to DAP4
void print_dap4(XMLWriter &xml) const
bool has_dap4_types(const std::string &path, std::vector< std::string > &inventory) const
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Read data from the stream made by D4StreamMarshaller.
static ostream & LMarg(ostream &strm)
Definition DapIndent.cc:61
static void Indent()
Definition DapIndent.cc:44
static void UnIndent()
Definition DapIndent.cc:46
A class for error processing.
Definition Error.h:92
A class for software fault reporting.
Definition InternalErr.h:61
abstract base class used to marshal/serialize dap data objects
Definition Marshaller.h:50
abstract base class used to unmarshall/deserialize dap data objects
Marshaller that knows how serialize dap data objects to a C++ iostream using XDR.
unsigned int get_doc_size()
Definition XMLWriter.cc:123
const char * get_doc()
Definition XMLWriter.cc:104
xmlTextWriterPtr get_writer() const
Definition XMLWriter.h:55
STL iterator class.
unsigned long long get_size(D4Group *grp, bool constrained=false)
Definition getdap4.cc:174
top level DAP object to house generic methods
Definition AISConnect.cc:30
@ dods_group_c
Definition Type.h:122
@ dods_grid_c
Definition Type.h:111
@ dods_structure_c
Definition Type.h:106
@ dods_array_c
Definition Type.h:107
string www2id(const string &in, const string &escape, const string &except)
Definition escaping.cc:202
string AttrType_to_String(const AttrType at)
Definition AttrTable.cc:93
Part
Names the parts of multi-section constructor data types.
Definition Type.h:48
@ array
Definition Type.h:50
@ Attr_uint32
Definition AttrTable.h:85
bool unique_names(vector< BaseType * > l, const string &var_name, const string &type_name, string &msg)
Definition util.cc:472
string id2www(string in, const string &allowable)
Definition escaping.cc:143