libdap Updated for version 3.21.0
libdap4 is an implementation of OPeNDAP's DAP protocol.
Constructor.cc
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 <cstdint>
35#include <string>
36#include <sstream>
37#include <algorithm>
38
39#include "crc.h"
40
41#include "Constructor.h"
42#include "Grid.h"
43
44#include "DMR.h"
45#include "XMLWriter.h"
46#include "D4StreamMarshaller.h"
47#include "D4StreamUnMarshaller.h"
48#include "D4Group.h"
49
50#include "D4Attributes.h"
51
52#include "escaping.h"
53#include "util.h"
54#include "InternalErr.h"
55#include "DapIndent.h"
56
57#include "debug.h"
58
59using namespace std;
60
61namespace libdap {
62
63// Private member functions
64
65void
66Constructor::m_duplicate(const Constructor &c)
67{
68 // Clear out any spurious vars in Constructor::d_vars
69 // Moved from Grid::m_duplicate. jhrg 4/3/13
70 d_vars.clear(); // [mjohnson 10 Sep 2009]
71
72 for (auto var: c.d_vars) {
73 BaseType *btp = var->ptr_duplicate();
74 btp->set_parent(this);
75 d_vars.push_back(btp);
76 }
77}
78
79// Public member functions
80
81// A public method, but just barely...
82// TODO Understand what this method does. What is dest? Is it the parent-to-be
83// of the variables in this Constructor? jhrg 4/25/22
84void
86{
87 for (Constructor::Vars_citer i = var_begin(), e = var_end(); i != e; ++i) {
88
89 BaseType *d4_var = dest->var((*i)->name());
90 // Don't add duplicate variables. We have to make this check
91 // because some child variables may add arrays
92 // to the root object. For example, this happens in
93 // Grid with the Map Arrays - ndp - 05/08/17
94 if (!d4_var) {
95 (*i)->transform_to_dap4(root /*group*/, dest /*container*/);
96 }
97 }
99 dest->set_is_dap4(true);
100}
101
102string
104{
105 if (get_parent() == 0)
106 return name();
107 else if (get_parent()->type() == dods_group_c)
108 return get_parent()->FQN() + name();
109 else if (get_parent()->type() == dods_array_c)
110 return get_parent()->FQN();
111 else
112 return get_parent()->FQN() + "." + name();
113}
114
115int
117{
118 if (!leaves)
119 return d_vars.size();
120 else {
121 int i = 0;
122 for (auto var: d_vars) {
123 i += var->element_count(leaves);
124 }
125 return i;
126 }
127}
128
129void
131{
132 for (auto var: d_vars) {
133 var->set_send_p(state);
134 }
135
137}
138
150void
152{
153 for (auto var: d_vars) {
154 var->set_read_p(state);
155 }
156
158}
159
168unsigned int
169Constructor::width(bool constrained) const
170{
171 unsigned int sz = 0;
172
173 for (auto var: d_vars) {
174 if (constrained) {
175 if (var->send_p())
176 sz += var->width(constrained);
177 }
178 else {
179 sz += var->width(constrained);
180 }
181 }
182
183 return sz;
184}
185
191int64_t
192Constructor::width_ll(bool constrained) const
193{
194 int64_t sz = 0;
195
196 for (auto var: d_vars) {
197 if (constrained) {
198 if (var->send_p())
199 sz += var->width_ll(constrained);
200 }
201 else {
202 sz += var->width_ll(constrained);
203 }
204 }
205
206 return sz;
207}
208
209BaseType *
210Constructor::var(const string &name, bool exact_match, btp_stack *s)
211{
212 string n = www2id(name);
213
214 if (exact_match)
215 return m_exact_match(n, s);
216 else
217 return m_leaf_match(n, s);
218}
219
221BaseType *
222Constructor::var(const string &n, btp_stack &s)
223{
224 // This should probably be removed. The BES code should remove web encoding
225 // with the possible exception of spaces. jhrg 11/25/13
226 string name = www2id(n);
227
228 BaseType *btp = m_exact_match(name, &s);
229 if (btp)
230 return btp;
231
232 return m_leaf_match(name, &s);
233}
234
235// Protected method
236BaseType *
237Constructor::m_leaf_match(const string &name, btp_stack *s)
238{
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 if (var->is_constructor_type()) {
247 BaseType *btp = var->var(name, false, s);
248 if (btp) {
249 if (s) {
250 s->push(static_cast<BaseType *>(this));
251 }
252 return btp;
253 }
254 }
255 }
256
257 return nullptr;
258}
259
260// Protected method
261BaseType *
262Constructor::m_exact_match(const string &name, btp_stack *s)
263{
264 // Look for name at the top level first.
265 for (auto var: d_vars) {
266 if (var->name() == name) {
267 if (s)
268 s->push(static_cast<BaseType *>(this));
269
270 return var;
271 }
272 }
273
274 // If it was not found using the simple search, look for a dot and
275 // search the hierarchy.
276 string::size_type dot_pos = name.find("."); // zero-based index of `.'
277 if (dot_pos != string::npos) {
278 string aggregate = name.substr(0, dot_pos);
279 string field = name.substr(dot_pos + 1);
280
281 BaseType *agg_ptr = var(aggregate);
282 if (agg_ptr) {
283 if (s)
284 s->push(static_cast<BaseType *>(this));
285
286 return agg_ptr->var(field, true, s); // recurse
287 }
288 else
289 return nullptr; // qualified names must be *fully* qualified
290 }
291
292 return nullptr;
293}
294
296Constructor::Vars_iter
298{
299 return d_vars.begin();
300}
301
304Constructor::Vars_iter
306{
307 return d_vars.end();
308}
309
311Constructor::Vars_riter
313{
314 return d_vars.rbegin();
315}
316
319Constructor::Vars_riter
321{
322 return d_vars.rend();
323}
324
328Constructor::Vars_iter
330{
331 return d_vars.begin() + i;
332}
333
337BaseType *
339{
340 return *(d_vars.begin() + i);
341}
342
353
354 if (!bt)
355 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
356
357 if (i<0 || i>= (int)(d_vars.size()))
358 throw InternalErr(__FILE__, __LINE__, "The index must be within the variable vector range..");
359
360 bt->set_parent(this);
361
362 // Update the is_dap4 property
363 if (bt->is_dap4())
364 set_is_dap4(true);
365
366 d_vars[i] = bt;
367
368}
369
374void
376{
377 // Jose Garcia
378 // Passing and invalid pointer to an object is a developer's error.
379 if (!bt)
380 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
381
382 // Jose Garcia
383 // Now we add a copy of bt so the external user is able to destroy bt as
384 // he/she wishes. The policy is: "If it is allocated outside, it is
385 // deallocated outside, if it is allocated inside, it is deallocated
386 // inside"
388}
389
394void
396{
397 if (!bt)
398 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
399
400 bt->set_parent(this);
401 d_vars.push_back(bt);
402
403 // Update the is_dap4 property
404 if (bt->is_dap4())
405 set_is_dap4(true);
406}
407
415void
416Constructor::del_var(const string &n)
417{
418 auto to_remove = stable_partition(d_vars.begin(), d_vars.end(),
419 [n](BaseType* btp){ return btp->name() != n; });
420 for_each(to_remove, d_vars.end(), [](BaseType* btp){ delete btp; });
421 d_vars.erase(to_remove, d_vars.end());
422}
423
429void
431{
432 delete *i;
433 d_vars.erase(i);
434}
435
448{
449 if (!read_p()) {
450 for (auto var: d_vars) {
451 if (var->send_p())
452 var->read();
453 }
454 // Set read_p for the Constructor
456 }
457
458 return false;
459}
460
461void
463{
464 if (is_dap4())
465 throw Error(string("A method usable only with DAP2 variables was called on a DAP4 variable (").append(name()).append(")."), __FILE__, __LINE__);
466
467 if (!read_p())
468 read(); // read() throws Error and InternalErr
469
470 for (auto var: d_vars) {
471 if (var->send_p()) {
472 var->intern_data(eval, dds);
473 }
474 }
475}
476
477bool
479{
480 if (!read_p())
481 read(); // read() throws Error and InternalErr
482
483 if (ce_eval && !eval.eval_selection(dds, dataset()))
484 return true;
485
486 for (auto var: d_vars) {
487 if (var->send_p()) {
488#ifdef CHECKSUMS
489 XDRStreamMarshaller *sm = dynamic_cast<XDRStreamMarshaller*>(&m);
490 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
491 sm->reset_checksum();
492
493 var->serialize(eval, dds, m, false);
494
495 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
496 sm->get_checksum();
497#else
498 // (*i)->serialize(eval, dds, m, false);
499 // Only Sequence and Vector run the evaluator.
500 var->serialize(eval, dds, m, true);
501#endif
502 }
503 }
504
505 return true;
506}
507
508bool
510{
511 for (auto var: d_vars) {
512 var->deserialize(um, dds, reuse);
513 }
514
515 return false;
516}
517
518void
520{
521 throw InternalErr(__FILE__, __LINE__, "Computing a checksum alone is not supported for Constructor types.");
522}
523
524void
526{
527 if (!read_p())
528 read(); // read() throws Error
529
530 for (auto var: d_vars) {
531 if (var->send_p()) {
532 var->intern_data(/*checksum, dmr, eval*/);
533 }
534 }
535}
536
548void
550{
551 // Not used for the same reason the equivalent code in D4Group::serialize()
552 // is not used. Fail for D4Sequence and general issues with memory use.
553 //
554 // Revisit this - I had to uncomment this to get the netcdf_handler code
555 // to work - it relies on having NCStructure::read() called. The D4Sequence
556 // ::serialize() method calls read_next_instance(). What seems to be happening
557 // is that this call to read gets the first set of values, but does not store
558 // them; the call to serialize then runs the D4Sequence::serialize() method that
559 // _does_ read all the sequence data and then serialize it. However, the first
560 // sequence instance is missing...
561 if (!read_p())
562 read(); // read() throws Error
563
564 for (auto var: d_vars) {
565 if (var->send_p()) {
566 var->serialize(m, dmr, filter);
567 }
568 }
569}
570
571void
573{
574 for (auto var: d_vars) {
575 var->deserialize(um, dmr);
576 }
577}
578
579void
580Constructor::print_decl(FILE *out, string space, bool print_semi, bool constraint_info, bool constrained)
581{
582 ostringstream oss;
583 print_decl(oss, space, print_semi, constraint_info, constrained);
584 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
585}
586
587void
588Constructor::print_decl(ostream &out, string space, bool print_semi, bool constraint_info, bool constrained)
589{
590 if (constrained && !send_p())
591 return;
592
593 out << space << type_name() << " {\n" ;
594 for (auto var: d_vars) {
595 var->print_decl(out, space + " ", true, constraint_info, constrained);
596 }
597 out << space << "} " << id2www(name()) ;
598
599 if (constraint_info) { // Used by test drivers only.
600 if (send_p())
601 out << ": Send True";
602 else
603 out << ": Send False";
604 }
605
606 if (print_semi)
607 out << ";\n" ;
608}
609
610void
611Constructor::print_val(FILE *out, string space, bool print_decl_p)
612{
613 ostringstream oss;
614 print_val(oss, space, print_decl_p);
615 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
616}
617
618void
619Constructor::print_val(ostream &out, string space, bool print_decl_p)
620{
621 if (print_decl_p) {
622 print_decl(out, space, false);
623 out << " = " ;
624 }
625
626 out << "{ " ;
627 for (Vars_citer i = d_vars.begin(), e = d_vars.end(); i != e; i++, (void)(i != e && out << ", ")) {
628 (*i)->print_val(out, "", false);
629 }
630
631 out << " }" ;
632
633 if (print_decl_p)
634 out << ";\n" ;
635}
636
640void
641Constructor::print_xml(FILE *out, string space, bool constrained)
642{
643 XMLWriter xml(space);
644 print_xml_writer(xml, constrained);
645 fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
646}
647
651void
652Constructor::print_xml(ostream &out, string space, bool constrained)
653{
654 XMLWriter xml(space);
655 print_xml_writer(xml, constrained);
656 out << xml.get_doc();
657}
658
659void
661{
662 if (constrained && !send_p())
663 return;
664
665 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
666 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
667
668 if (!name().empty())
669 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
670 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
671
672 // DAP2 prints attributes first. For some reason we decided that DAP4 should
673 // print them second. No idea why... jhrg 8/15/14
674 if (!is_dap4() && get_attr_table().get_size() > 0)
676
677 if (!d_vars.empty())
678 for_each(d_vars.begin(), d_vars.end(),
679 [&xml, constrained](BaseType *btp) { btp->print_xml_writer(xml, constrained); });
680
681 if (is_dap4())
682 attributes()->print_dap4(xml);
683
684 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
685 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
686}
687
688void
689Constructor::print_dap4(XMLWriter &xml, bool constrained)
690{
691 if (constrained && !send_p())
692 return;
693
694 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
695 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
696
697 if (!name().empty())
698 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
699 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
700
701 if (!d_vars.empty())
702 for_each(d_vars.begin(), d_vars.end(),
703 [&xml, constrained](BaseType *btp) { btp->print_dap4(xml, constrained); });
704
705 attributes()->print_dap4(xml);
706
707 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
708 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
709}
710
711bool
712Constructor::check_semantics(string &msg, bool all)
713{
715 return false;
716
717 if (!unique_names(d_vars, name(), type_name(), msg))
718 return false;
719
720 if (all) {
721 for (auto var: d_vars) {
722 if (!var->check_semantics(msg, true)) {
723 return false;
724 }
725 }
726 }
727
728 return true;
729}
730
740bool
742{
743 return false;
744}
745
751void
753{
754 for (auto var: d_vars) {
755 var->set_in_selection(state);
756 }
757
759}
760
762{
763 AttrTable *at = at_container->get_attr_table(name());
764
765 if (at) {
766 BaseType::transfer_attributes(at_container);
767 for (auto var: d_vars) {
769 }
770 }
771}
772
773AttrTable *
774Constructor::make_dropped_vars_attr_table(vector<BaseType *> *dropped_vars)
775{
776 AttrTable *dv_table = nullptr;
777 if (!dropped_vars->empty()) {
778 dv_table = new AttrTable;
779 dv_table->set_name("dap4:dropped_members");
780
781 vector<BaseType *>::iterator dvIter = dropped_vars->begin();
782 vector<BaseType *>::iterator dvEnd = dropped_vars->end();
783 unsigned int i = 0;
784 for (; dvIter != dvEnd; dvIter++, i++) {
785 BaseType *bt = (*dvIter);
786
787 AttrTable *bt_attr_table = new AttrTable(bt->get_attr_table());
788 bt_attr_table->set_name(bt->name());
789 string type_name = bt->type_name();
790
791 if (bt->is_vector_type()) {
792 Array *array = dynamic_cast <Array *>(bt);
793 if (array) { // This is always true - only an Array is_vector_type(). jhrg 4/25/22
794 type_name = array->prototype()->type_name();
795 Array::Dim_iter d_iter = array->dim_begin();
796 Array::Dim_iter end = array->dim_end();
797 for (; d_iter < end; d_iter++) {
798
799 ostringstream dim_size;
800 dim_size << (*d_iter).size;
801 bt_attr_table->append_attr("array_dimensions", AttrType_to_String(Attr_uint32), dim_size.str());
802 }
803 }
804 }
805
806 bt_attr_table->append_attr("dap4:type", "String", type_name);
807 dv_table->append_container(bt_attr_table, bt_attr_table->get_name());
808 // Clear entry now that we're done.
809 (*dvIter) = 0;
810 }
811 }
812
813 return dv_table;
814}
815
816
823bool Constructor::is_dap4_projected(std::vector<std::string> &inventory)
824{
825 bool has_projected_dap4 = false;
826 if(send_p()) {
827 has_projected_dap4 = attributes()->has_dap4_types(FQN(),inventory);
828 for (const auto var: variables()) {
829 has_projected_dap4 |= var->is_dap4_projected(inventory);
830 }
831 }
832 return has_projected_dap4;
833}
834
835
844void
845Constructor::dump(ostream &strm) const {
846 strm << DapIndent::LMarg << "Constructor::dump - (" << (void *) this << ")" << endl;
847 DapIndent::Indent();
848 BaseType::dump(strm);
849 strm << DapIndent::LMarg << "vars: " << endl;
850 DapIndent::Indent();
851
852 for (auto var: d_vars) {
853 var->dump(strm);
854 }
855
856 DapIndent::UnIndent();
857 DapIndent::UnIndent();
858}
859
860} // namespace libdap
861
Definition crc.h:77
A multidimensional array of identical data types.
Definition Array.h:123
std::vector< dimension >::iterator Dim_iter
Definition Array.h:241
Contains the attributes for a dataset.
Definition AttrTable.h:154
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition AttrTable.cc:554
virtual void set_name(const string &n)
Set the name of this attribute table.
Definition AttrTable.cc:273
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Definition AttrTable.cc:751
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition AttrTable.cc:335
virtual string get_name() const
Get the name of this attribute table.
Definition AttrTable.cc:266
void print_xml_writer(XMLWriter &xml)
The basic data type for the DODS DAP types.
Definition BaseType.h:120
virtual bool is_dap4_projected(std::vector< string > &projected_dap4_inventory)
Definition BaseType.cc:1323
virtual string type_name() const
Returns the type of the class instance as a string.
Definition BaseType.cc:376
virtual bool read()
Read data into a local buffer.
Definition BaseType.cc:905
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
Definition BaseType.cc:949
virtual AttrTable & get_attr_table()
Definition BaseType.cc:579
virtual string name() const
Returns the name of the class instance.
Definition BaseType.cc:317
virtual void set_in_selection(bool state)
Definition BaseType.cc:715
virtual void print_decl(FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
Definition BaseType.cc:1009
virtual BaseType * get_parent() const
Definition BaseType.cc:748
virtual bool read_p()
Has this variable been read?
Definition BaseType.cc:477
virtual unsigned int width(bool constrained=false) const
How many bytes does this variable use Return the number of bytes of storage this variable uses....
Definition BaseType.cc:1305
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition BaseType.cc:513
virtual string dataset() const
Returns the name of the dataset used to create this instance.
Definition BaseType.cc:355
virtual void set_parent(BaseType *parent)
Definition BaseType.cc:730
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Definition BaseType.cc:440
void dump(ostream &strm) const override
dumps information about this object
Definition BaseType.cc:287
virtual bool is_vector_type() const
Returns true if the instance is a vector (i.e., array) type variable.
Definition BaseType.cc:399
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Definition BaseType.cc:914
virtual bool is_constructor_type() const
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Definition BaseType.cc:409
virtual D4Attributes * attributes()
Definition BaseType.cc:596
virtual std::string FQN() const
Definition BaseType.cc:329
virtual bool send_p()
Should this variable be sent?
Definition BaseType.cc:551
virtual void set_send_p(bool state)
Definition BaseType.cc:565
virtual BaseType * ptr_duplicate()=0
virtual void transform_to_dap4(D4Group *root, Constructor *container)
DAP2 to DAP4 transform.
Definition BaseType.cc:212
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net, then remove them from the object.
Definition BaseType.cc:943
virtual void transfer_attributes(AttrTable *at)
Definition BaseType.cc:641
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition BaseType.cc:1215
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Definition BaseType.cc:126
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:764
virtual Type type() const
Returns the type of the class instance.
Definition BaseType.cc:362
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 ...
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
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.
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()
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)
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.
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
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.
A class for error processing.
Definition Error.h:94
A class for software fault reporting.
Definition InternalErr.h:65
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.
top level DAP object to house generic methods
Definition AISConnect.cc:30
string www2id(const string &in, const string &escape, const string &except)
Definition escaping.cc:220
string AttrType_to_String(const AttrType at)
Definition AttrTable.cc:97
Part
Names the parts of multi-section constructor data types.
Definition Type.h:48
string id2www(string in, const string &allowable)
Definition escaping.cc:153