libdap Updated for version 3.20.11
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 <string>
35#include <sstream>
36#include <algorithm>
37
38#include "crc.h"
39
40#include "Constructor.h"
41#include "Grid.h"
42
43#include "DMR.h"
44#include "XMLWriter.h"
45#include "D4StreamMarshaller.h"
46#include "D4StreamUnMarshaller.h"
47#include "D4Group.h"
48
49#include "D4Attributes.h"
50
51#include "escaping.h"
52#include "util.h"
53#include "InternalErr.h"
54#include "DapIndent.h"
55
56#include "debug.h"
57
58using namespace std;
59
60namespace libdap {
61
62// Private member functions
63
64void
65Constructor::m_duplicate(const Constructor &c)
66{
67 // Clear out any spurious vars in Constructor::d_vars
68 // Moved from Grid::m_duplicate. jhrg 4/3/13
69 d_vars.clear(); // [mjohnson 10 Sep 2009]
70
71 for (auto var: c.d_vars) {
72 BaseType *btp = var->ptr_duplicate();
73 btp->set_parent(this);
74 d_vars.push_back(btp);
75 }
76}
77
78// Public member functions
79
80// A public method, but just barely...
81// TODO Understand what this method does. What is dest? Is it the parent-to-be
82// of the variables in this Constructor? jhrg 4/25/22
83void
85{
86 for (Constructor::Vars_citer i = var_begin(), e = var_end(); i != e; ++i) {
87
88 BaseType *d4_var = dest->var((*i)->name());
89 // Don't add duplicate variables. We have to make this check
90 // because some child variables may add arrays
91 // to the root object. For example, this happens in
92 // Grid with the Map Arrays - ndp - 05/08/17
93 if (!d4_var) {
94 (*i)->transform_to_dap4(root /*group*/, dest /*container*/);
95 }
96 }
98 dest->set_is_dap4(true);
99}
100
101string
103{
104 if (get_parent() == 0)
105 return name();
106 else if (get_parent()->type() == dods_group_c)
107 return get_parent()->FQN() + name();
108 else if (get_parent()->type() == dods_array_c)
109 return get_parent()->FQN();
110 else
111 return get_parent()->FQN() + "." + name();
112}
113
114int
116{
117 if (!leaves)
118 return d_vars.size();
119 else {
120 int i = 0;
121 for (auto var: d_vars) {
122 i += var->element_count(leaves);
123 }
124 return i;
125 }
126}
127
128void
130{
131 for (auto var: d_vars) {
132 var->set_send_p(state);
133 }
134
136}
137
149void
151{
152 for (auto var: d_vars) {
153 var->set_read_p(state);
154 }
155
157}
158
166unsigned int
167Constructor::width(bool constrained) const
168{
169 unsigned int sz = 0;
170
171 for (auto var: d_vars) {
172 if (constrained) {
173 if (var->send_p())
174 sz += var->width(constrained);
175 }
176 else {
177 sz += var->width(constrained);
178 }
179 }
180
181 return sz;
182}
183
184BaseType *
185Constructor::var(const string &name, bool exact_match, btp_stack *s)
186{
187 string n = www2id(name);
188
189 if (exact_match)
190 return m_exact_match(n, s);
191 else
192 return m_leaf_match(n, s);
193}
194
196BaseType *
197Constructor::var(const string &n, btp_stack &s)
198{
199 // This should probably be removed. The BES code should remove web encoding
200 // with the possible exception of spaces. jhrg 11/25/13
201 string name = www2id(n);
202
203 BaseType *btp = m_exact_match(name, &s);
204 if (btp)
205 return btp;
206
207 return m_leaf_match(name, &s);
208}
209
210// Protected method
211BaseType *
212Constructor::m_leaf_match(const string &name, btp_stack *s)
213{
214 for (auto var: d_vars) {
215 if (var->name() == name) {
216 if (s) {
217 s->push(static_cast<BaseType *>(this));
218 }
219 return var;
220 }
221 if (var->is_constructor_type()) {
222 BaseType *btp = var->var(name, false, s);
223 if (btp) {
224 if (s) {
225 s->push(static_cast<BaseType *>(this));
226 }
227 return btp;
228 }
229 }
230 }
231
232 return nullptr;
233}
234
235// Protected method
236BaseType *
237Constructor::m_exact_match(const string &name, btp_stack *s)
238{
239 // Look for name at the top level first.
240 for (auto var: d_vars) {
241 if (var->name() == name) {
242 if (s)
243 s->push(static_cast<BaseType *>(this));
244
245 return var;
246 }
247 }
248
249 // If it was not found using the simple search, look for a dot and
250 // search the hierarchy.
251 string::size_type dot_pos = name.find("."); // zero-based index of `.'
252 if (dot_pos != string::npos) {
253 string aggregate = name.substr(0, dot_pos);
254 string field = name.substr(dot_pos + 1);
255
256 BaseType *agg_ptr = var(aggregate);
257 if (agg_ptr) {
258 if (s)
259 s->push(static_cast<BaseType *>(this));
260
261 return agg_ptr->var(field, true, s); // recurse
262 }
263 else
264 return nullptr; // qualified names must be *fully* qualified
265 }
266
267 return nullptr;
268}
269
271Constructor::Vars_iter
273{
274 return d_vars.begin();
275}
276
279Constructor::Vars_iter
281{
282 return d_vars.end();
283}
284
286Constructor::Vars_riter
288{
289 return d_vars.rbegin();
290}
291
294Constructor::Vars_riter
296{
297 return d_vars.rend();
298}
299
303Constructor::Vars_iter
305{
306 return d_vars.begin() + i;
307}
308
312BaseType *
314{
315 return *(d_vars.begin() + i);
316}
317
322void
324{
325 // Jose Garcia
326 // Passing and invalid pointer to an object is a developer's error.
327 if (!bt)
328 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
329
330 // Jose Garcia
331 // Now we add a copy of bt so the external user is able to destroy bt as
332 // he/she wishes. The policy is: "If it is allocated outside, it is
333 // deallocated outside, if it is allocated inside, it is deallocated
334 // inside"
335 BaseType *btp = bt->ptr_duplicate();
336 btp->set_parent(this);
337 d_vars.push_back(btp);
338}
339
344void
346{
347 if (!bt)
348 throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null.");
349
350 bt->set_parent(this);
351 d_vars.push_back(bt);
352}
353
361void
362Constructor::del_var(const string &n)
363{
364 auto to_remove = stable_partition(d_vars.begin(), d_vars.end(),
365 [n](BaseType* btp){ return btp->name() != n; });
366 for_each(to_remove, d_vars.end(), [](BaseType* btp){ delete btp; });
367 d_vars.erase(to_remove, d_vars.end());
368}
369
375void
377{
378 delete *i;
379 d_vars.erase(i);
380}
381
394{
395 if (!read_p()) {
396 for (auto var: d_vars) {
397 if (var->send_p())
398 var->read();
399 }
400 // Set read_p for the Constructor
402 }
403
404 return false;
405}
406
407void
409{
410 if (!read_p())
411 read(); // read() throws Error and InternalErr
412
413 for (auto var: d_vars) {
414 if (var->send_p()) {
415 var->intern_data(eval, dds);
416 }
417 }
418}
419
420bool
422{
423 if (!read_p())
424 read(); // read() throws Error and InternalErr
425
426 if (ce_eval && !eval.eval_selection(dds, dataset()))
427 return true;
428
429 for (auto var: d_vars) {
430 if (var->send_p()) {
431#ifdef CHECKSUMS
432 XDRStreamMarshaller *sm = dynamic_cast<XDRStreamMarshaller*>(&m);
433 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
434 sm->reset_checksum();
435
436 var->serialize(eval, dds, m, false);
437
438 if (sm && sm->checksums() && var->type() != dods_structure_c && var->type() != dods_grid_c)
439 sm->get_checksum();
440#else
441 // (*i)->serialize(eval, dds, m, false);
442 // Only Sequence and Vector run the evaluator.
443 var->serialize(eval, dds, m, true);
444#endif
445 }
446 }
447
448 return true;
449}
450
451bool
453{
454 for (auto var: d_vars) {
455 var->deserialize(um, dds, reuse);
456 }
457
458 return false;
459}
460
461void
463{
464 throw InternalErr(__FILE__, __LINE__, "Computing a checksum alone is not supported for Constructor types.");
465}
466
467void
469{
470 for (auto var: d_vars) {
471 if (var->send_p()) {
472 var->intern_data(/*checksum, dmr, eval*/);
473 }
474 }
475}
476
488void
490{
491 // Not used for the same reason the equivalent code in D4Group::serialize()
492 // is not used. Fail for D4Sequence and general issues with memory use.
493 //
494 // Revisit this - I had to uncomment this to get the netcdf_handler code
495 // to work - it relies on having NCStructure::read() called. The D4Sequence
496 // ::serialize() method calls read_next_instance(). What seems to be happening
497 // is that this call to read gets the first set of values, but does not store
498 // them; the call to serialize then runs the D4Sequence::serialize() method that
499 // _does_ read all the sequence data and then serialize it. However, the first
500 // sequence instance is missing...
501 if (!read_p())
502 read(); // read() throws Error
503
504 for (auto var: d_vars) {
505 if (var->send_p()) {
506 var->serialize(m, dmr, filter);
507 }
508 }
509}
510
511void
513{
514 for (auto var: d_vars) {
515 var->deserialize(um, dmr);
516 }
517}
518
519void
520Constructor::print_decl(FILE *out, string space, bool print_semi,
521 bool constraint_info, bool constrained)
522{
523 ostringstream oss;
524 print_decl(oss, space, print_semi, constraint_info, constrained);
525 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
526}
527
528void
529Constructor::print_decl(ostream &out, string space, bool print_semi,
530 bool constraint_info, bool constrained)
531{
532 if (constrained && !send_p())
533 return;
534
535 out << space << type_name() << " {\n" ;
536 for (auto var: d_vars) {
537 var->print_decl(out, space + " ", true, constraint_info, constrained);
538 }
539 out << space << "} " << id2www(name()) ;
540
541 if (constraint_info) { // Used by test drivers only.
542 if (send_p())
543 out << ": Send True";
544 else
545 out << ": Send False";
546 }
547
548 if (print_semi)
549 out << ";\n" ;
550}
551
552void
553Constructor::print_val(FILE *out, string space, bool print_decl_p)
554{
555 ostringstream oss;
556 print_val(oss, space, print_decl_p);
557 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
558}
559
560void
561Constructor::print_val(ostream &out, string space, bool print_decl_p)
562{
563 if (print_decl_p) {
564 print_decl(out, space, false);
565 out << " = " ;
566 }
567
568 out << "{ " ;
569 for (Vars_citer i = d_vars.begin(), e = d_vars.end(); i != e; i++, (void)(i != e && out << ", ")) {
570 (*i)->print_val(out, "", false);
571 }
572
573 out << " }" ;
574
575 if (print_decl_p)
576 out << ";\n" ;
577}
578
582void
583Constructor::print_xml(FILE *out, string space, bool constrained)
584{
585 XMLWriter xml(space);
586 print_xml_writer(xml, constrained);
587 fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
588}
589
593void
594Constructor::print_xml(ostream &out, string space, bool constrained)
595{
596 XMLWriter xml(space);
597 print_xml_writer(xml, constrained);
598 out << xml.get_doc();
599}
600
601void
603{
604 if (constrained && !send_p())
605 return;
606
607 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
608 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
609
610 if (!name().empty())
611 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
612 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
613
614 // DAP2 prints attributes first. For some reason we decided that DAP4 should
615 // print them second. No idea why... jhrg 8/15/14
616 if (!is_dap4() && get_attr_table().get_size() > 0)
618
619 if (!d_vars.empty())
620 for_each(d_vars.begin(), d_vars.end(),
621 [&xml, constrained](BaseType *btp) { btp->print_xml_writer(xml, constrained); });
622
623 if (is_dap4())
624 attributes()->print_dap4(xml);
625
626 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
627 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
628}
629
630void
631Constructor::print_dap4(XMLWriter &xml, bool constrained)
632{
633 if (constrained && !send_p())
634 return;
635
636 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
637 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
638
639 if (!name().empty())
640 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
641 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
642
643 if (!d_vars.empty())
644 for_each(d_vars.begin(), d_vars.end(),
645 [&xml, constrained](BaseType *btp) { btp->print_dap4(xml, constrained); });
646
647 attributes()->print_dap4(xml);
648
649 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
650 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
651}
652
653bool
654Constructor::check_semantics(string &msg, bool all)
655{
657 return false;
658
659 if (!unique_names(d_vars, name(), type_name(), msg))
660 return false;
661
662 if (all) {
663 for (auto var: d_vars) {
664 if (!var->check_semantics(msg, true)) {
665 return false;
666 }
667 }
668 }
669
670 return true;
671}
672
682bool
684{
685 return false;
686}
687
693void
695{
696 for (auto var: d_vars) {
697 var->set_in_selection(state);
698 }
699
701}
702
704{
705 AttrTable *at = at_container->get_attr_table(name());
706
707 if (at) {
708 BaseType::transfer_attributes(at_container);
709 for (auto var: d_vars) {
711 }
712 }
713}
714
715AttrTable *
716Constructor::make_dropped_vars_attr_table(vector<BaseType *> *dropped_vars)
717{
718 AttrTable *dv_table = nullptr;
719 if (!dropped_vars->empty()) {
720 dv_table = new AttrTable;
721 dv_table->set_name("dap4:dropped_members");
722
723 vector<BaseType *>::iterator dvIter = dropped_vars->begin();
724 vector<BaseType *>::iterator dvEnd = dropped_vars->end();
725 unsigned int i = 0;
726 for (; dvIter != dvEnd; dvIter++, i++) {
727 BaseType *bt = (*dvIter);
728
729 AttrTable *bt_attr_table = new AttrTable(bt->get_attr_table());
730 bt_attr_table->set_name(bt->name());
731 string type_name = bt->type_name();
732
733 if (bt->is_vector_type()) {
734 Array *array = dynamic_cast <Array *>(bt);
735 if (array) { // This is always true - only an Array is_vector_type(). jhrg 4/25/22
736 type_name = array->prototype()->type_name();
737 Array::Dim_iter d_iter = array->dim_begin();
738 Array::Dim_iter end = array->dim_end();
739 for (; d_iter < end; d_iter++) {
740
741 ostringstream dim_size;
742 dim_size << (*d_iter).size;
743 bt_attr_table->append_attr("array_dimensions", AttrType_to_String(Attr_uint32), dim_size.str());
744 }
745 }
746 }
747
748 bt_attr_table->append_attr("dap4:type", "String", type_name);
749 dv_table->append_container(bt_attr_table, bt_attr_table->get_name());
750 // Clear entry now that we're done.
751 (*dvIter) = 0;
752 }
753 }
754
755 return dv_table;
756}
757
766void
767Constructor::dump(ostream &strm) const {
768 strm << DapIndent::LMarg << "Constructor::dump - (" << (void *) this << ")" << endl;
769 DapIndent::Indent();
770 BaseType::dump(strm);
771 strm << DapIndent::LMarg << "vars: " << endl;
772 DapIndent::Indent();
773
774 for (auto var: d_vars) {
775 var->dump(strm);
776 }
777
778 DapIndent::UnIndent();
779 DapIndent::UnIndent();
780}
781
782} // namespace libdap
783
Definition: crc.h:77
A multidimensional array of identical data types.
Definition: Array.h:113
std::vector< dimension >::iterator Dim_iter
Definition: Array.h:206
Contains the attributes for a dataset.
Definition: AttrTable.h:143
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition: AttrTable.cc:410
virtual void set_name(const string &n)
Set the name of this attribute table.
Definition: AttrTable.cc:245
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Definition: AttrTable.cc:607
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition: AttrTable.cc:307
virtual string get_name() const
Get the name of this attribute table.
Definition: AttrTable.cc:238
void print_xml_writer(XMLWriter &xml)
Definition: AttrTable.cc:1425
The basic data type for the DODS DAP types.
Definition: BaseType.h:118
virtual string type_name() const
Returns the type of the class instance as a string.
Definition: BaseType.cc:375
virtual bool read()
Read data into a local buffer.
Definition: BaseType.cc:895
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
Definition: BaseType.cc:939
virtual AttrTable & get_attr_table()
Definition: BaseType.cc:578
virtual string name() const
Returns the name of the class instance.
Definition: BaseType.cc:316
virtual void set_in_selection(bool state)
Definition: BaseType.cc:714
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:999
virtual BaseType * get_parent() const
Definition: BaseType.cc:747
virtual bool read_p()
Has this variable been read?
Definition: BaseType.cc:476
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:1295
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition: BaseType.cc:512
virtual string dataset() const
Returns the name of the dataset used to create this instance.
Definition: BaseType.cc:354
virtual void set_parent(BaseType *parent)
Definition: BaseType.cc:729
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Definition: BaseType.cc:439
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:398
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Definition: BaseType.cc:904
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:408
virtual D4Attributes * attributes()
Definition: BaseType.cc:595
virtual std::string FQN() const
Definition: BaseType.cc:328
virtual bool send_p()
Should this variable be sent?
Definition: BaseType.cc:550
virtual void set_send_p(bool state)
Definition: BaseType.cc:564
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:933
virtual void transfer_attributes(AttrTable *at)
Definition: BaseType.cc:640
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition: BaseType.cc:1205
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:754
virtual Type type() const
Returns the type of the class instance.
Definition: BaseType.cc:361
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.
Definition: Constructor.cc:115
void compute_checksum(Crc32 &checksum) override
include the data for this variable in the checksum DAP4 includes a checksum with every data response....
Definition: Constructor.cc:462
void transform_to_dap4(D4Group *root, Constructor *dest) override
DAP2 to DAP4 transform.
Definition: Constructor.cc:84
Vars_iter get_vars_iter(int i)
Definition: Constructor.cc:304
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())
Definition: Constructor.cc:185
void add_var(BaseType *bt, Part part=nil) override
Definition: Constructor.cc:323
void transfer_attributes(AttrTable *at) override
Definition: Constructor.cc:703
void print_xml_writer(XMLWriter &xml, bool constrained=false) override
Definition: Constructor.cc:602
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.
Definition: Constructor.cc:529
void print_xml(ostream &out, string space=" ", bool constrained=false) override
Definition: Constructor.cc:594
bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false) override
Receive data from the net.
Definition: Constructor.cc:452
void intern_data() override
Read data into this variable.
Definition: Constructor.cc:468
void set_read_p(bool state) override
Set the 'read_p' property for the Constructor and its members.
Definition: Constructor.cc:150
void print_val(FILE *out, string space="", bool print_decl_p=true) override
Prints the value of the variable.
Definition: Constructor.cc:553
void set_send_p(bool state) override
Definition: Constructor.cc:129
Vars_iter var_end()
Definition: Constructor.cc:280
bool read() override
Read the elements of Constructor marked for transmission.
Definition: Constructor.cc:393
void set_in_selection(bool state) override
Set the in_selection property.
Definition: Constructor.cc:694
bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true) override
Move data to the net, then remove them from the object.
Definition: Constructor.cc:421
Vars_riter var_rbegin()
Definition: Constructor.cc:287
void add_var_nocopy(BaseType *bt, Part part=nil) override
Definition: Constructor.cc:345
unsigned int width(bool constrained=false) const override
Definition: Constructor.cc:167
BaseType * get_var_index(int i)
Definition: Constructor.cc:313
bool check_semantics(string &msg, bool all=false) override
Compare an object's current state with the semantics of its type.
Definition: Constructor.cc:654
Vars_iter var_begin()
Definition: Constructor.cc:272
void print_dap4(XMLWriter &xml, bool constrained=false) override
Definition: Constructor.cc:631
std::string FQN() const override
Definition: Constructor.cc:102
Vars_riter var_rend()
Definition: Constructor.cc:295
virtual bool is_linear()
Check to see whether this variable can be printed simply.
Definition: Constructor.cc:683
virtual void del_var(const string &name)
Remove an element from a Constructor.
Definition: Constructor.cc:362
void dump(ostream &strm) const override
dumps information about this object
Definition: Constructor.cc:767
void transform_to_dap4(AttrTable &at)
copy attributes from DAP2 to DAP4
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 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
Definition: UnMarshaller.h:55
Marshaller that knows how serialize dap data objects to a C++ iostream using XDR.
top level DAP object to house generic methods
Definition: AlarmHandler.h:36
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