libdap Updated for version 3.21.0
libdap4 is an implementation of OPeNDAP's DAP protocol.
BaseType.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 1994-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// Implementation for BaseType.
33//
34// jhrg 9/6/94
35
36#include "config.h"
37
38#include <cstdio> // for stdin and stdout
39
40#include <sstream>
41#include <string>
42
43//#define DODS_DEBUG
44
45#include "BaseType.h"
46#include "Byte.h"
47#include "Int16.h"
48#include "UInt16.h"
49#include "Int32.h"
50#include "UInt32.h"
51#include "Float32.h"
52#include "Float64.h"
53#include "Str.h"
54#include "Url.h"
55#include "Array.h"
56#include "Structure.h"
57#include "Sequence.h"
58#include "Grid.h"
59
60#include "D4Attributes.h"
61#include "DMR.h"
62#include "XMLWriter.h"
63#include "D4BaseTypeFactory.h"
64
65#include "InternalErr.h"
66
67#include "util.h"
68#include "escaping.h"
69#include "DapIndent.h"
70
71#include "debug.h"
72
73using namespace std;
74
75namespace libdap {
76
77// Protected copy mfunc
78
85void
87{
88 DBG(cerr << "In BaseType::m_duplicate for " << bt.name() << endl);
89
90 d_name = bt.d_name;
91 d_type = bt.d_type;
92 d_dataset = bt.d_dataset;
93 d_is_read = bt.d_is_read; // added, reza
94 d_is_send = bt.d_is_send; // added, reza
95 d_in_selection = bt.d_in_selection;
96 d_is_synthesized = bt.d_is_synthesized; // 5/11/2001 jhrg
97
98 d_parent = bt.d_parent; // copy pointers 6/4/2001 jhrg
99
100 d_attr = bt.d_attr; // Deep copy.
101
102 if (bt.d_attributes)
103 d_attributes = new D4Attributes(*bt.d_attributes); // deep copy
104 else
105 d_attributes = 0; // init to null if not used.
106
107 d_is_dap4 = bt.d_is_dap4;
108
109 DBG(cerr << "Exiting BaseType::m_duplicate for " << bt.name() << endl);
110}
111
112// Public mfuncs
113
126BaseType::BaseType(const string &n, const Type &t, bool is_dap4)
127: d_name(n), d_type(t), d_dataset(""), d_is_read(false), d_is_send(false),
128 d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
129 d_in_selection(false), d_is_synthesized(false)
130{}
131
144BaseType::BaseType(const string &n, const string &d, const Type &t, bool is_dap4)
145: d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false),
146 d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
147 d_in_selection(false), d_is_synthesized(false)
148{}
149
151BaseType::BaseType(const BaseType &copy_from) : DapObj()
152{
153 DBG(cerr << "In BaseTpe::copy_ctor for " << copy_from.name() << endl);
154 m_duplicate(copy_from);
155}
156
157BaseType::~BaseType()
158{
159 DBG2(cerr << "Entering ~BaseType (" << this << ")" << endl);
160
161 if (d_attributes)
162 delete d_attributes;
163
164 DBG2(cerr << "Exiting ~BaseType" << endl);
165}
166
167BaseType &
168BaseType::operator=(const BaseType &rhs)
169{
170 if (this == &rhs)
171 return *this;
172 m_duplicate(rhs);
173 return *this;
174}
175
181{
182 ostringstream oss;
183 oss << "BaseType (" << this << "):" << endl
184 << " _name: " << name() << endl
185 << " _type: " << type_name() << endl
186 << " _dataset: " << d_dataset << endl
187 << " _read_p: " << d_is_read << endl
188 << " _send_p: " << d_is_send << endl
189 << " _synthesized_p: " << d_is_synthesized << endl
190 << " d_parent: " << d_parent << endl
191 << " d_attr: " << hex << &d_attr << dec << endl;
192
193 return oss.str();
194}
195
211void
213{
214 BaseType *dest = ptr_duplicate();
215 // If it's already a DAP4 object then we can just return it!
216 if(!is_dap4()){
218 dest->set_is_dap4(true);
219 }
220 container->add_var_nocopy(dest);
221}
222
223
254std::vector<BaseType *> *
256{
257 BaseType *dest = this->ptr_duplicate();
258 // convert the d4 attributes to a dap2 attribute table.
259 // HK-403. jhrg 6/17/19
260#if 0
261 AttrTable *attrs = this->attributes()->get_AttrTable(name());
262 dest->set_attr_table(*attrs);
263#else
264 if (dest->get_attr_table().get_size() == 0) {
266 dest->get_attr_table().set_name(name());
267 }
268#endif
269
270 dest->set_is_dap4(false);
271
272 vector<BaseType *> *result = new vector<BaseType *>();
273 result->push_back(dest);
274 return result;
275}
276
277
286void
287BaseType::dump(ostream &strm) const
288{
289 strm << DapIndent::LMarg << "BaseType::dump - ("
290 << (void *)this << ")" << endl ;
291 DapIndent::Indent() ;
292
293 strm << DapIndent::LMarg << "name: " << name() << endl ;
294 strm << DapIndent::LMarg << "type: " << type_name() << endl ;
295 strm << DapIndent::LMarg << "dataset: " << d_dataset << endl ;
296 strm << DapIndent::LMarg << "read_p: " << d_is_read << endl ;
297 strm << DapIndent::LMarg << "send_p: " << d_is_send << endl ;
298 strm << DapIndent::LMarg << "synthesized_p: " << d_is_synthesized << endl ;
299 strm << DapIndent::LMarg << "d_is_dap4: " << d_is_dap4 << endl;
300 strm << DapIndent::LMarg << "parent: " << (void *)d_parent << endl ;
301 strm << DapIndent::LMarg << "attributes: " << endl ;
302 DapIndent::Indent() ;
303
304 if (d_attributes)
305 d_attributes->dump(strm);
306 else
307 d_attr.dump(strm) ;
308
309 DapIndent::UnIndent() ;
310
311 DapIndent::UnIndent() ;
312}
313
316string
318{
319 return d_name;
320}
321
328string
330{
331 if (get_parent() == 0)
332 return name();
333 else if (get_parent()->type() == dods_group_c)
334 return get_parent()->FQN() + name();
335 else
336 return get_parent()->FQN() + "." + name();
337}
338
340void
341BaseType::set_name(const string &n)
342{
343 string name = n;
344 d_name = www2id(name); // www2id writes into its param.
345}
346
354string
356{
357 return d_dataset;
358}
359
361Type
363{
364 return d_type;
365}
366
368void
370{
371 d_type = t;
372}
373
375string
377{
378 if (is_dap4())
379 return libdap::D4type_name(d_type);
380 else
381 return libdap::D2type_name(d_type);
382}
383
389bool
391{
393}
394
398bool
400{
402}
403
408bool
413
439int
441{
442 return 1;
443}
444
448bool
450{
451 return d_is_synthesized;
452}
453
459void
461{
462 d_is_synthesized = state;
463}
464
465// Return the state of d_is_read (true if the value of the variable has been
466// read (and is in memory) false otherwise).
467
476bool
478{
479 return d_is_read;
480}
481
512void
514{
515 // The this comment is/was wrong!
516 // The is_synthesized property was not being used and the more I thought
517 // about how this was coded, the more this code below seemed like a bad idea.
518 // Once the property was set, the read_p property could not be changed.
519 // That seems a little silly. Also, I think I need to use this is_synthesized
520 // property for some of the server function code I'm working on for Raytheon,
521 // and I'd like to be able to control the read_p property! jhrg 3/9/15
522
523 // What's true: The is_synthesized property is used by
524 // 'projection functions' in the freeform handler. It might be better
525 // to modify the FFtypes to support this behavior, but for now I'm returning
526 // the library to its old behavior. That this change (setting is_read
527 // of the value of is_syn...) broke the FF handler was not detected
528 // because the FF tests were not being run due to an error in the FF
529 // bes-testsuite Makefile.am). jhrg 9/9/15
530
531#if 1
532 if (!d_is_synthesized) {
533 d_is_read = state;
534 }
535#else
536 d_is_read = state;
537#endif
538}
539
550bool
552{
553 return d_is_send;
554}
555
564void
566{
567 DBG2(cerr << "Calling BaseType::set_send_p() for: " << this->name()
568 << endl);
569 d_is_send = state;
570}
571
572
578AttrTable &
580{
581 return d_attr;
582}
583
586void
588{
589 d_attr = at;
590}
591
597{
598 if (!d_attributes) d_attributes = new D4Attributes();
599 return d_attributes;
600}
601
602void
603BaseType::set_attributes(D4Attributes *attrs)
604{
605 d_attributes = new D4Attributes(*attrs);
606}
607
608void
609BaseType::set_attributes_nocopy(D4Attributes *attrs)
610{
611 d_attributes = attrs;
612}
614
642
643 DBG(cerr << __func__ << "() - BEGIN name:'" << name() << "'" << endl);
644
645 AttrTable *at = at_container->get_attr_table(name());
646 DBG(cerr << __func__ << "() - at: "<< (void *) at << endl);
647
648
649 if (at) {
650 at->set_is_global_attribute(false);
651 DBG(cerr << __func__ << "() - Processing AttrTable: " << at->get_name() << endl);
652
653 AttrTable::Attr_iter at_p = at->attr_begin();
654 while (at_p != at->attr_end()) {
655 DBG(cerr << __func__ << "() - Attribute '" << at->get_name(at_p) << "' is type: " << at->get_type(at_p) << endl);
656 if (at->get_attr_type(at_p) == Attr_container){
657 // An attribute container may actually represent a child member variable. When
658 // that's the case we don't want to add the container to the parent type, but
659 // rather let any child of BaseType deal with those containers in the child's
660 // overridden transfer_attributes() method.
661 // We capitalize on the magic of the BaseType API and utilize the var() method
662 // to check for a child variable of the same name and, if one exists, we'll skip
663 // this AttrTable and let a child constructor class like Grid or Constructor
664 // deal with it.
665 BaseType *bt = var(at->get_name(at_p),true);
666 if(bt==0){
667 DBG(cerr << __func__ << "() - Adding container '" << at->get_name(at_p) << endl);
669 }
670 else {
671 DBG(cerr << __func__ << "() - Found child var: '"<< bt->type_name()<< " " << bt->name() << " (address:" << (void *) bt << ")" << endl);
672 DBG(cerr << __func__ << "() - Skipping container '" << at->get_name(at_p) << endl);
673 }
674 }
675 else {
676 DBG(cerr << __func__ << "() - Adding Attribute '" << at->get_name(at_p) << endl);
677 get_attr_table().append_attr(at->get_name(at_p), at->get_type(at_p), at->get_attr_vector(at_p),(*at_p)->is_utf8_str);
678 }
679 at_p++;
680 }
681 }
682 else {
683 DBG(cerr << __func__ << "() - Unable to locate AttrTable '" << name() << "' SKIPPING" << endl);
684
685 }
686}
687
699bool
701{
702 return d_in_selection;
703}
704
714void
716{
717 d_in_selection = state;
718}
719
720// Protected method.
729void
731{
732 if (!dynamic_cast<Constructor *>(parent)
733 && !dynamic_cast<Vector *>(parent)
734 && parent != 0)
735 throw InternalErr("Call to set_parent with incorrect variable type.");
736
737 d_parent = parent;
738}
739
740// Public method.
741
747BaseType *
749{
750 return d_parent;
751}
752
753BaseType *
754BaseType::get_ancestor()
755{
756 if (d_parent)
757 return d_parent->get_ancestor();
758 else
759 return this;
760}
761
762// Documented in the header file.
763BaseType *
764BaseType::var(const string &/*name*/, bool /*exact_match*/, btp_stack */*s*/)
765{
766 return static_cast<BaseType *>(0);
767}
768
785BaseType *
786BaseType::var(const string &, btp_stack &)
787{
788 return static_cast<BaseType *>(0);
789}
790
820void
822{
823 throw InternalErr(__FILE__, __LINE__, "BaseType::add_var unimplemented");
824}
825
826void
827BaseType::add_var_nocopy(BaseType *, Part)
828{
829 throw InternalErr(__FILE__, __LINE__, "BaseType::add_var_nocopy unimplemented");
830}
831
904bool
906{
907 if (d_is_read)
908 return true;
909
910 throw InternalErr("Unimplemented BaseType::read() method called for the variable named: " + name());
911}
912
913void
915{
916#if USE_LOCAL_TIMEOUT_SCHEME
917 dds.timeout_on();
918#endif
919 if (is_dap4())
920 throw Error(string("A method usable only with DAP2 variables was called on a DAP4 variable (").append(name()).append(")."), __FILE__, __LINE__);
921
922 DBG2(cerr << "BaseType::intern_data: " << name() << endl);
923 if (!read_p())
924 read(); // read() throws Error and InternalErr
925#if USE_LOCAL_TIMEOUT_SCHEME
926 dds.timeout_off();
927#endif
928}
929
935void
937{
938 if (!read_p())
939 read(); // read() throws Error and InternalErr
940}
941
942bool
944{
945 throw InternalErr(__FILE__, __LINE__, "The DAP2 serialize() method has not been implemented for " + type_name());
946}
947
948bool
950{
951 throw InternalErr(__FILE__, __LINE__, "The DAP2 deserialize() method has not been implemented for " + type_name());
952}
953
954void
955BaseType::serialize(D4StreamMarshaller &, DMR &, /*ConstraintEvaluator &,*/ bool)
956{
957 throw InternalErr(__FILE__, __LINE__, "The DAP4 serialize() method has not been implemented for " + type_name());
958}
959
960void
962{
963 throw InternalErr(__FILE__, __LINE__, "The DAP4 deserialize() method has not been implemented for " + type_name());
964}
965
1008void
1009BaseType::print_decl(FILE *out, string space, bool print_semi,
1010 bool constraint_info, bool constrained)
1011{
1012 ostringstream oss;
1013 print_decl(oss, space, print_semi, constraint_info, constrained);
1014 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
1015}
1016
1059void
1060BaseType::print_decl(ostream &out, string space, bool print_semi,
1061 bool constraint_info, bool constrained)
1062{
1063 // if printing the constrained declaration, exit if this variable was not
1064 // selected.
1065 if (constrained && !send_p())
1066 return;
1067
1068 out << space << type_name() << " " << id2www(name()) ;
1069
1070 if (constraint_info) {
1071 if (send_p())
1072 out << ": Send True" ;
1073 else
1074 out << ": Send False" ;
1075 }
1076
1077 if (print_semi)
1078 out << ";\n" ;
1079}
1080
1095void
1096BaseType::print_val(FILE *out, string space, bool print_decl_p)
1097{
1098 ostringstream oss;
1099 print_val(oss, space, print_decl_p);
1100 fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
1101}
1102
1110void
1111BaseType::print_xml(FILE *out, string space, bool constrained)
1112{
1113 XMLWriter xml(space);
1114 print_xml_writer(xml, constrained);
1115 fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
1116}
1117
1125void
1126BaseType::print_xml(ostream &out, string space, bool constrained)
1127{
1128 XMLWriter xml(space);
1129 print_xml_writer(xml, constrained);
1130 out << xml.get_doc();
1131}
1132
1139void
1141{
1142 if (constrained && !send_p())
1143 return;
1144
1145 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
1146 throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
1147
1148 if (!name().empty())
1149 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
1150 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
1151
1152 if (is_dap4())
1153 attributes()->print_dap4(xml);
1154
1155 if (!is_dap4() && get_attr_table().get_size() > 0)
1157
1158 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1159 throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
1160}
1161
1169void
1170BaseType::print_dap4(XMLWriter &xml, bool constrained)
1171{
1172 print_xml_writer(xml, constrained);
1173}
1174
1175// Compares the object's current state with the semantics of a particular
1176// type. This will typically be defined in ctor classes (which have
1177// complicated semantics). For BaseType, an object is semantically correct if
1178// it has both a non-null name and type.
1179//
1180// NB: This is not the same as an invariant -- during the parse objects exist
1181// but have no name. Also, the bool ALL defaults to false for BaseType. It is
1182// used by children of CtorType.
1183//
1184// Returns: true if the object is semantically correct, false otherwise.
1185
1214bool
1216{
1217 bool sem = (d_type != dods_null_c && name().length());
1218
1219 if (!sem)
1220 msg = "Every variable must have both a name and a type\n";
1221
1222 return sem;
1223}
1224
1261bool
1263{
1264 // Even though ops is a public method, it can never be called because
1265 // they will never have a BaseType object since this class is abstract,
1266 // however any of the child classes could by mistake call BaseType::ops
1267 // so this is an internal error. Jose Garcia
1268 throw InternalErr(__FILE__, __LINE__, "Unimplemented operator.");
1269}
1270
1287bool
1289{
1290 throw InternalErr(__FILE__, __LINE__, "Unimplemented operator.");
1291}
1292
1304unsigned int
1305BaseType::width(bool /* constrained */) const
1306{
1307 throw InternalErr(__FILE__, __LINE__, "not implemented");
1308}
1309
1310int64_t
1311BaseType::width_ll(bool /* constrained */) const
1312{
1313 throw InternalErr(__FILE__, __LINE__, "not implemented");
1314}
1315
1316
1323bool BaseType::is_dap4_projected(std::vector<string> &inventory)
1324{
1325 bool has_projected_dap4 = false;
1326 if(send_p()) {
1327 has_projected_dap4 = attributes()->has_dap4_types(FQN(), inventory);
1328 }
1329 return has_projected_dap4;
1330}
1331
1332
1333} // namespace libdap
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 Attr_iter attr_end()
Definition AttrTable.cc:863
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
Definition AttrTable.cc:757
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
Definition AttrTable.cc:797
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 Attr_iter attr_begin()
Definition AttrTable.cc:855
virtual string get_name() const
Get the name of this attribute table.
Definition AttrTable.cc:266
void print_xml_writer(XMLWriter &xml)
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
Definition AttrTable.cc:259
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.
Definition AttrTable.cc:765
The basic data type for the DODS DAP types.
Definition BaseType.h:120
void m_duplicate(const BaseType &bt)
Perform a deep copy.
Definition BaseType.cc:86
virtual bool is_dap4_projected(std::vector< string > &projected_dap4_inventory)
Definition BaseType.cc:1323
virtual void print_xml_writer(XMLWriter &xml, bool constrained=false)
Definition BaseType.cc:1140
virtual string type_name() const
Returns the type of the class instance as a string.
Definition BaseType.cc:376
virtual void intern_data()
Read data into this variable.
Definition BaseType.cc:936
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 bool d4_ops(BaseType *b, int op)
Evaluator a relop for DAP4.
Definition BaseType.cc:1288
virtual void set_attr_table(const AttrTable &at)
Definition BaseType.cc:587
virtual void set_synthesized_p(bool state)
Definition BaseType.cc:460
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 string toString()
Definition BaseType.cc:180
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 print_xml(FILE *out, string space=" ", bool constrained=false)
Definition BaseType.cc:1111
virtual void set_name(const string &n)
Sets the name of the class instance.
Definition BaseType.cc:341
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
Definition BaseType.cc:1262
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 bool is_simple_type() const
Returns true if the instance is a numeric, string or URL type variable.
Definition BaseType.cc:390
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 add_var(BaseType *bt, Part part=nil)
Add a variable.
Definition BaseType.cc:821
virtual void transfer_attributes(AttrTable *at)
Definition BaseType.cc:641
virtual bool is_in_selection()
Is this variable part of the current selection?
Definition BaseType.cc:700
virtual bool synthesized_p()
Definition BaseType.cc:449
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 void set_type(const Type &t)
Sets the type of the class instance.
Definition BaseType.cc:369
virtual Type type() const
Returns the type of the class instance.
Definition BaseType.cc:362
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Definition BaseType.cc:1096
virtual void print_dap4(XMLWriter &xml, bool constrained=false)
Definition BaseType.cc:1170
virtual std::vector< BaseType * > * transform_to_dap2(AttrTable *parent_attr_table)
DAP4 to DAP2 transform.
Definition BaseType.cc:255
Evaluate a constraint expression.
void add_var_nocopy(BaseType *bt, Part part=nil) override
void transform_to_dap4(AttrTable &at)
copy attributes from DAP2 to DAP4
void transform_attrs_to_dap2(AttrTable *d2_attr_table)
Copy the attributes from this D4Attributes object to a DAP2 AttrTable.
bool has_dap4_types(const std::string &path, std::vector< std::string > &inventory) const
virtual void dump(ostream &strm) const
dumps information about this object
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.
libdap base object for common functionality of libdap objects
Definition DapObj.h:51
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
Holds a one-dimensional collection of DAP2 data types.
Definition Vector.h:83
top level DAP object to house generic methods
Type
Identifies the data type.
Definition Type.h:94
string www2id(const string &in, const string &escape, const string &except)
Definition escaping.cc:220
bool is_simple_type(Type t)
Returns true if the instance is a numeric, string or URL type variable.
Definition util.cc:778
string D2type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only typ...
Definition util.cc:652
string D4type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only typ...
Definition util.cc:697
bool is_constructor_type(Type t)
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Definition util.cc:862
bool is_vector_type(Type t)
Returns true if the instance is a vector (i.e., array) type variable.
Definition util.cc:818
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