libdap++  Updated for version 3.14.0
BaseType.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 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 
70 #include "debug.h"
71 
72 using namespace std;
73 
74 namespace libdap {
75 
76 // Protected copy mfunc
77 
84 void
85 BaseType::m_duplicate(const BaseType &bt)
86 {
87  DBG(cerr << "In BaseType::m_duplicate for " << bt.name() << endl);
88 
89  d_name = bt.d_name;
90  d_type = bt.d_type;
91  d_dataset = bt.d_dataset;
92  d_is_read = bt.d_is_read; // added, reza
93  d_is_send = bt.d_is_send; // added, reza
94  d_in_selection = bt.d_in_selection;
95  d_is_synthesized = bt.d_is_synthesized; // 5/11/2001 jhrg
96 
97  d_parent = bt.d_parent; // copy pointers 6/4/2001 jhrg
98 
99  d_attr = bt.d_attr; // Deep copy.
100 
101  if (bt.d_attributes)
102  d_attributes = new D4Attributes(*bt.d_attributes); // deep copy
103  else
104  d_attributes = 0; // init to null if not used.
105 
106  d_is_dap4 = bt.d_is_dap4;
107 
108  DBG(cerr << "Exiting BaseType::m_duplicate for " << bt.name() << endl);
109 }
110 
111 // Public mfuncs
112 
125 BaseType::BaseType(const string &n, const Type &t, bool is_dap4)
126  : d_name(n), d_type(t), d_dataset(""), d_is_read(false), d_is_send(false),
127  d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
128  d_in_selection(false), d_is_synthesized(false)
129 {}
130 
143 BaseType::BaseType(const string &n, const string &d, const Type &t, bool is_dap4)
144  : d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false),
145  d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
146  d_in_selection(false), d_is_synthesized(false)
147 {}
148 
150 BaseType::BaseType(const BaseType &copy_from) : DapObj()
151 {
152  DBG(cerr << "In BaseTpe::copy_ctor for " << copy_from.name() << endl);
153  m_duplicate(copy_from);
154 }
155 
157 {
158  DBG2(cerr << "Entering ~BaseType (" << this << ")" << endl);
159 
160  if (d_attributes)
161  delete d_attributes;
162 
163  DBG2(cerr << "Exiting ~BaseType" << endl);
164 }
165 
166 BaseType &
168 {
169  DBG(cerr << "Entering BaseType::operator=" << endl);
170  if (this == &rhs)
171  return *this;
172 
173  m_duplicate(rhs);
174 
175  DBG(cerr << "Exiting BaseType::operator=" << endl);
176  return *this;
177 }
178 
183 string
185 {
186  ostringstream oss;
187  oss << "BaseType (" << this << "):" << endl
188  << " _name: " << d_name << endl
189  << " _type: " << type_name() << endl
190  << " _dataset: " << d_dataset << endl
191  << " _read_p: " << d_is_read << endl
192  << " _send_p: " << d_is_send << endl
193  << " _synthesized_p: " << d_is_synthesized << endl
194  << " d_parent: " << d_parent << endl
195  << " d_attr: " << hex << &d_attr << dec << endl;
196 
197  return oss.str();
198 }
199 
215 BaseType *
217 {
218  BaseType *dest = ptr_duplicate();
219 
220  // Copy the D2 attributes from 'this' to dest's D4 Attributes
222 
223  dest->set_is_dap4(true);
224 
225  return dest;
226 }
227 
236 void
237 BaseType::dump(ostream &strm) const
238 {
239  strm << DapIndent::LMarg << "BaseType::dump - ("
240  << (void *)this << ")" << endl ;
242 
243  strm << DapIndent::LMarg << "name: " << d_name << endl ;
244  strm << DapIndent::LMarg << "type: " << type_name() << endl ;
245  strm << DapIndent::LMarg << "dataset: " << d_dataset << endl ;
246  strm << DapIndent::LMarg << "read_p: " << d_is_read << endl ;
247  strm << DapIndent::LMarg << "send_p: " << d_is_send << endl ;
248  strm << DapIndent::LMarg << "synthesized_p: " << d_is_synthesized << endl ;
249  strm << DapIndent::LMarg << "parent: " << (void *)d_parent << endl ;
250  strm << DapIndent::LMarg << "attributes: " << endl ;
252  d_attr.dump(strm) ;
254 
256 }
257 
260 string
262 {
263  return d_name;
264 }
265 
272 string
274 {
275  if (get_parent() == 0)
276  return name();
277  else if (get_parent()->type() == dods_group_c)
278  return get_parent()->FQN() + name();
279  else
280  return get_parent()->FQN() + "." + name();
281 }
282 
284 void
285 BaseType::set_name(const string &n)
286 {
287  string name = n;
288  d_name = www2id(name); // www2id writes into its param.
289 }
290 
298 string
300 {
301  return d_dataset;
302 }
303 
305 Type
307 {
308  return d_type;
309 }
310 
312 void
314 {
315  d_type = t;
316 }
317 
319 string
321 {
322  if (is_dap4())
323  return libdap::D4type_name(d_type);
324  else
325  return libdap::D2type_name(d_type);
326 }
327 
333 bool
335 {
336  return libdap::is_simple_type(type());
337 }
338 
342 bool
344 {
345  return libdap::is_vector_type(type());
346 }
347 
352 bool
354 {
356 }
357 
383 int
385 {
386  return 1;
387 }
388 
392 bool
394 {
395  return d_is_synthesized;
396 }
397 
403 void
405 {
406  d_is_synthesized = state;
407 }
408 
409 // Return the state of d_is_read (true if the value of the variable has been
410 // read (and is in memory) false otherwise).
411 
420 bool
422 {
423  return d_is_read;
424 }
425 
453 void
455 {
456  d_is_read = state;
457 
458  // The is_synthesized property was not being used and the more I thought
459  // about how this was coded, the more this code below seemed like a bad idea.
460  // Once the property was set, the read_p property could not be changed.
461  // That seems a little silly. Also, I think I need to use this is_synthesized
462  // property for some of the server function code I'm working on for Raytheon,
463  // and I'd like to be able to control the read_p property! jhrg 3/9/15
464 #if 0
465  if (! d_is_synthesized) {
466  DBG2(cerr << "Changing read_p state of " << name() << " to "
467  << state << endl);
468  d_is_read = state;
469  }
470 #endif
471 }
472 
483 bool
485 {
486  return d_is_send;
487 }
488 
497 void
499 {
500  DBG2(cerr << "Calling BaseType::set_send_p() for: " << this->name()
501  << endl);
502  d_is_send = state;
503 }
504 
505 
511 AttrTable &
513 {
514  return d_attr;
515 }
516 
519 void
521 {
522  d_attr = at;
523 }
524 
528 D4Attributes *
530 {
531  if (!d_attributes) d_attributes = new D4Attributes();
532  return d_attributes;
533 }
534 
535 void
537 {
538  d_attributes = new D4Attributes(*attrs);
539 }
540 
541 void
543 {
544  d_attributes = attrs;
545 }
547 
575  AttrTable *at = at_container->get_attr_table(name());
576 
577  DBG(cerr << "In BaseType::transfer_attributes; processing " << name() << endl);
578 
579  if (at) {
580  at->set_is_global_attribute(false);
581  DBG(cerr << "Processing AttrTable: " << at->get_name() << endl);
582 
583  AttrTable::Attr_iter at_p = at->attr_begin();
584  while (at_p != at->attr_end()) {
585  DBG(cerr << "About to append " << "attr name, type:" << at->get_name(at_p) << ", " << at->get_type(at_p) << endl);
586 
587  if (at->get_attr_type(at_p) == Attr_container)
588  get_attr_table().append_container(new AttrTable(*at->get_attr_table(at_p)), at->get_name(at_p));
589  else
590  get_attr_table().append_attr(at->get_name(at_p), at->get_type(at_p), at->get_attr_vector(at_p));
591 
592  at_p++;
593  }
594  }
595 }
596 
608 bool
610 {
611  return d_in_selection;
612 }
613 
623 void
625 {
626  d_in_selection = state;
627 }
628 
629 // Protected method.
638 void
640 {
641  if (!dynamic_cast<Constructor *>(parent)
642  && !dynamic_cast<Vector *>(parent)
643  && parent != 0)
644  throw InternalErr("Call to set_parent with incorrect variable type.");
645 
646  d_parent = parent;
647 }
648 
649 // Public method.
650 
656 BaseType *
658 {
659  return d_parent;
660 }
661 
662 // Documented in the header file.
663 BaseType *
664 BaseType::var(const string &/*name*/, bool /*exact_match*/, btp_stack */*s*/)
665 {
666  return static_cast<BaseType *>(0);
667 }
668 
685 BaseType *
686 BaseType::var(const string &, btp_stack &)
687 {
688  return static_cast<BaseType *>(0);
689 }
690 
720 void
722 {
723  throw InternalErr(__FILE__, __LINE__, "BaseType::add_var unimplemented");
724 }
725 
726 void
728 {
729  throw InternalErr(__FILE__, __LINE__, "BaseType::add_var_nocopy unimplemented");
730 }
731 
804 bool
806 {
807  if (d_is_read)
808  return true;
809 
810  throw InternalErr("Unimplemented BaseType::read() method called for the variable named: " + name());
811 }
812 
813 void
815 {
816  dds.timeout_on();
817  DBG2(cerr << "BaseType::intern_data: " << name() << endl);
818  if (!read_p())
819  read(); // read() throws Error and InternalErr
820 
821  dds.timeout_off();
822 }
823 
829 void
830 BaseType::intern_data(Crc32 &checksum/*, DMR &, ConstraintEvaluator &*/)
831 {
832  if (!read_p())
833  read(); // read() throws Error and InternalErr
834 
835  compute_checksum(checksum);
836 }
837 
838 bool
840 {
841  throw InternalErr(__FILE__, __LINE__, "The DAP2 serialize() method has not been implemented for " + type_name());
842 }
843 
844 bool
846 {
847  throw InternalErr(__FILE__, __LINE__, "The DAP2 deserialize() method has not been implemented for " + type_name());
848 }
849 
850 void
851 BaseType::serialize(D4StreamMarshaller &, DMR &, /*ConstraintEvaluator &,*/ bool)
852 {
853  throw InternalErr(__FILE__, __LINE__, "The DAP4 serialize() method has not been implemented for " + type_name());
854 }
855 
856 void
858 {
859  throw InternalErr(__FILE__, __LINE__, "The DAP4 deserialize() method has not been implemented for " + type_name());
860 }
861 
904 void
905 BaseType::print_decl(FILE *out, string space, bool print_semi,
906  bool constraint_info, bool constrained)
907 {
908  ostringstream oss;
909  print_decl(oss, space, print_semi, constraint_info, constrained);
910  fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
911 }
912 
955 void
956 BaseType::print_decl(ostream &out, string space, bool print_semi,
957  bool constraint_info, bool constrained)
958 {
959  // if printing the constrained declaration, exit if this variable was not
960  // selected.
961  if (constrained && !send_p())
962  return;
963 
964  out << space << type_name() << " " << id2www(d_name) ;
965 
966  if (constraint_info) {
967  if (send_p())
968  out << ": Send True" ;
969  else
970  out << ": Send False" ;
971  }
972 
973  if (print_semi)
974  out << ";\n" ;
975 }
976 
991 void
992 BaseType::print_val(FILE *out, string space, bool print_decl_p)
993 {
994  ostringstream oss;
995  print_val(oss, space, print_decl_p);
996  fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
997 }
998 
1006 void
1007 BaseType::print_xml(FILE *out, string space, bool constrained)
1008 {
1009  XMLWriter xml(space);
1010  print_xml_writer(xml, constrained);
1011  fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
1012 }
1013 
1021 void
1022 BaseType::print_xml(ostream &out, string space, bool constrained)
1023 {
1024  XMLWriter xml(space);
1025  print_xml_writer(xml, constrained);
1026  out << xml.get_doc();
1027 }
1028 
1035 void
1036 BaseType::print_xml_writer(XMLWriter &xml, bool constrained)
1037 {
1038  if (constrained && !send_p())
1039  return;
1040 
1041  if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
1042  throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
1043 
1044  if (!d_name.empty())
1045  if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0)
1046  throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
1047 
1048  if (is_dap4())
1049  attributes()->print_dap4(xml);
1050 
1051  if (!is_dap4() && get_attr_table().get_size() > 0)
1053 
1054  if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1055  throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
1056 }
1057 
1065 void
1066 BaseType::print_dap4(XMLWriter &xml, bool constrained)
1067 {
1068  print_xml_writer(xml, constrained);
1069 }
1070 
1071 // Compares the object's current state with the semantics of a particular
1072 // type. This will typically be defined in ctor classes (which have
1073 // complicated semantics). For BaseType, an object is semantically correct if
1074 // it has both a non-null name and type.
1075 //
1076 // NB: This is not the same as an invariant -- during the parse objects exist
1077 // but have no name. Also, the bool ALL defaults to false for BaseType. It is
1078 // used by children of CtorType.
1079 //
1080 // Returns: true if the object is semantically correct, false otherwise.
1081 
1110 bool
1111 BaseType::check_semantics(string &msg, bool)
1112 {
1113  bool sem = (d_type != dods_null_c && d_name.length());
1114 
1115  if (!sem)
1116  msg = "Every variable must have both a name and a type\n";
1117 
1118  return sem;
1119 }
1120 
1155 bool
1157 {
1158  // Even though ops is a public method, it can never be called because
1159  // they will never have a BaseType object since this class is abstract,
1160  // however any of the child classes could by mistake call BaseType::ops
1161  // so this is an internal error. Jose Garcia
1162  throw InternalErr(__FILE__, __LINE__, "Unimplemented operator.");
1163 }
1164 
1178 unsigned int
1179 BaseType::width(bool /* constrained */) const
1180 {
1181  throw InternalErr(__FILE__, __LINE__, "not implemented");
1182 #if 0
1183  return width(constrained);
1184 #endif
1185 }
1186 
1187 } // namespace libdap
std::vector< entry * >::iterator Attr_iter
Definition: AttrTable.h:229
void set_is_dap4(const bool v)
Definition: BaseType.h:167
virtual bool read()
Read data into a local buffer.
Definition: BaseType.cc:805
virtual bool read_p()
Has this variable been read?
Definition: BaseType.cc:421
static void UnIndent()
Definition: DapIndent.cc:51
abstract base class used to unmarshall/deserialize dap data objects
Definition: UnMarshaller.h:54
virtual unsigned int width(bool constrained=false) const
How many bytes does this use Return the number of bytes of storage this variable uses. For scalar types, this is pretty simple (an int32 uses 4 bytes, etc.). For arrays and Constructors, it is a bit more complex. Note that a scalar String variable uses sizeof(String*) bytes, not the length of the string. In other words, the value returned is independent of the type. Also note width() of a String array returns the number of elements in the array times sizeof(String*). That is, each different array size is a different data type.
Definition: BaseType.cc:1179
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:905
virtual void set_attributes_nocopy(D4Attributes *)
Definition: BaseType.cc:542
xmlTextWriterPtr get_writer()
Definition: XMLWriter.h:56
virtual void print_dap4(XMLWriter &xml, bool constrained=false)
Definition: BaseType.cc:1066
virtual Attr_iter attr_end()
Definition: AttrTable.cc:718
virtual ~BaseType()
Definition: BaseType.cc:156
virtual void print_xml(FILE *out, string space=" ", bool constrained=false)
Definition: BaseType.cc:1007
Part
Names the parts of multi-section constructor data types.
Definition: Type.h:48
BaseType & operator=(const BaseType &rhs)
Definition: BaseType.cc:167
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:905
Contains the attributes for a dataset.
Definition: AttrTable.h:142
virtual void set_name(const string &n)
Sets the name of the class instance.
Definition: BaseType.cc:285
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
Definition: BaseType.cc:845
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
Definition: AttrTable.cc:612
bool is_dap4() const
Definition: BaseType.h:166
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Definition: BaseType.cc:814
virtual void print_xml_writer(XMLWriter &xml, bool constrained=false)
Definition: BaseType.cc:1036
Read data from the stream made by D4StreamMarshaller.
Definition: crc.h:76
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Definition: BaseType.cc:125
bool d_in_selection
Definition: BaseType.h:143
bool is_vector_type(Type t)
Returns true if the instance is a vector (i.e., array) type variable.
Definition: util.cc:858
virtual void set_is_global_attribute(bool ga)
Definition: AttrTable.h:277
void print_xml_writer(XMLWriter &xml)
Definition: AttrTable.cc:1424
void timeout_off()
Definition: DDS.cc:894
virtual void add_var(BaseType *bt, Part part=nil)
Add a variable.
Definition: BaseType.cc:721
Type
Identifies the data type.
Definition: Type.h:94
Type type() const
Returns the type of the class instance.
Definition: BaseType.cc:306
virtual string get_name() const
Get the name of this attribute table.
Definition: AttrTable.cc:237
virtual string toString()
Definition: BaseType.cc:184
#define DBG2(x)
Definition: debug.h:73
virtual void set_in_selection(bool state)
Definition: BaseType.cc:624
virtual bool is_in_selection()
Is this variable part of the current selection?
Definition: BaseType.cc:609
stack< BaseType * > btp_stack
Definition: BaseType.h:149
virtual void set_parent(BaseType *parent)
Definition: BaseType.cc:639
A class for software fault reporting.
Definition: InternalErr.h:64
string dataset() const
Returns the name of the dataset used to create this instance.
Definition: BaseType.cc:299
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
Definition: BaseType.cc:664
virtual void compute_checksum(Crc32 &checksum)=0
include the data for this variable in the checksum DAP4 includes a checksum with every data response...
#define DBG(x)
Definition: debug.h:58
string type_name() const
Returns the type of the class instance as a string.
Definition: BaseType.cc:320
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Definition: BaseType.cc:992
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net.
Definition: BaseType.cc:839
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:353
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Definition: BaseType.cc:384
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
virtual void set_send_p(bool state)
Definition: BaseType.cc:498
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition: AttrTable.cc:409
const char * get_doc()
Definition: XMLWriter.cc:105
static void Indent()
Definition: DapIndent.cc:45
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Definition: AttrTable.cc:606
virtual BaseType * get_parent() const
Definition: BaseType.cc:657
virtual void dump(ostream &strm) const
dumps information about this object
Definition: BaseType.cc:237
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:732
virtual bool is_vector_type() const
Returns true if the instance is a vector (i.e., array) type variable.
Definition: BaseType.cc:343
void set_type(const Type &t)
Sets the type of the class instance.
Definition: BaseType.cc:313
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition: BaseType.cc:454
bool is_simple_type(Type t)
Returns true if the instance is a numeric, string or URL type variable.
Definition: util.cc:815
virtual D4Attributes * attributes()
Definition: BaseType.cc:529
virtual std::string FQN() const
Definition: BaseType.cc:273
virtual bool synthesized_p()
Definition: BaseType.cc:393
virtual void add_var_nocopy(BaseType *bt, Part part=nil)
Definition: BaseType.cc:727
string name() const
Returns the name of the class instance.
Definition: BaseType.cc:261
virtual Attr_iter attr_begin()
Definition: AttrTable.cc:710
virtual BaseType * ptr_duplicate()=0
string www2id(const string &in, const string &escape, const string &except)
Definition: escaping.cc:220
void timeout_on()
Definition: DDS.cc:886
void m_duplicate(const BaseType &bt)
Perform a deep copy.
Definition: BaseType.cc:85
Evaluate a constraint expression.
bool d_is_synthesized
Definition: BaseType.h:144
static ostream & LMarg(ostream &strm)
Definition: DapIndent.cc:80
virtual bool is_simple_type() const
Returns true if the instance is a numeric, string or URL type variable.
Definition: BaseType.cc:334
virtual AttrTable & get_attr_table()
Definition: BaseType.cc:512
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition: AttrTable.cc:306
The basic data type for the DODS DAP types.
Definition: BaseType.h:117
virtual void set_attributes(D4Attributes *)
Definition: BaseType.cc:536
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:686
libdap base object for common functionality of libdap objects
Definition: DapObj.h:55
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
Definition: AttrTable.cc:620
abstract base class used to marshal/serialize dap data objects
Definition: Marshaller.h:53
virtual void set_attr_table(const AttrTable &at)
Definition: BaseType.cc:520
virtual void dump(ostream &strm) const
dumps information about this object
Definition: AttrTable.cc:1509
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
Definition: BaseType.cc:1156
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
Definition: AttrTable.cc:652
virtual void transfer_attributes(AttrTable *at)
Definition: BaseType.cc:574
void transform_to_dap4(AttrTable &at)
copy attributes from DAP2 to DAP4
virtual bool send_p()
Should this variable be sent?
Definition: BaseType.cc:484
string id2www(string in, const string &allowable)
Definition: escaping.cc:153
void print_dap4(XMLWriter &xml) const
unsigned int get_doc_size()
Definition: XMLWriter.cc:129
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition: BaseType.cc:1111
virtual BaseType * transform_to_dap4(D4Group *root, Constructor *container)
DAP2 to DAP4 transform.
Definition: BaseType.cc:216
virtual void set_synthesized_p(bool state)
Definition: BaseType.cc:404