82 DBG2(cerr <<
"BaseType::_duplicate: " << bt.d_name <<
" send_p: "
83 << bt.d_is_send << endl);
86 d_dataset = bt.d_dataset;
87 d_is_read = bt.d_is_read;
88 d_is_send = bt.d_is_send;
89 d_in_selection = bt.d_in_selection;
90 d_is_synthesized = bt.d_is_synthesized;
92 d_parent = bt.d_parent;
117 BaseType::BaseType(
const string &n,
const Type &t,
bool is_dap4)
118 : d_name(n), d_type(t), d_dataset(
""), d_is_read(false), d_is_send(false),
119 d_in_selection(false), d_is_synthesized(false), d_parent(0),
136 : d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false),
137 d_in_selection(false), d_is_synthesized(false), d_parent(0),
153 : d_name(n), d_type(t), d_dataset(
""), d_is_read(false), d_is_send(false),
154 d_in_selection(false), d_is_synthesized(false), d_parent(0),
172 : d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false),
173 d_in_selection(false), d_is_synthesized(false), d_parent(0),
185 DBG2(cerr <<
"Entering ~BaseType (" <<
this <<
")" << endl);
186 DBG2(cerr <<
"Exiting ~BaseType" << endl);
208 oss <<
"BaseType (" <<
this <<
"):" << endl
209 <<
" _name: " << d_name << endl
211 <<
" _dataset: " << d_dataset << endl
212 <<
" _read_p: " << d_is_read << endl
213 <<
" _send_p: " << d_is_send << endl
214 <<
" _synthesized_p: " << d_is_synthesized << endl
215 <<
" d_parent: " << d_parent << endl
216 <<
" d_attr: " << hex << &d_attr << dec << endl;
233 << (
void *)
this <<
")" << endl ;
302 return string(
"Null");
304 return string(
"Byte");
306 return string(
"Int16");
308 return string(
"UInt16");
310 return string(
"Int32");
312 return string(
"UInt32");
314 return string(
"Float32");
316 return string(
"Float64");
318 return string(
"String");
320 return string(
"Url");
322 return string(
"Array");
324 return string(
"Structure");
326 return string(
"Sequence");
328 return string(
"Grid");
331 return string(
"Int8");
333 return string(
"UInt8");
335 return string(
"Int64");
337 return string(
"UInt64");
339 return string(
"URL");
341 return string(
"Group");
343 return string(
"Enum");
346 cerr <<
"BaseType::type_name: Undefined type" << endl;
498 BaseType::is_dap4_only_type()
510 BaseType::is_dap2_only_type()
553 return d_is_synthesized;
564 d_is_synthesized = state;
620 if (! d_is_synthesized) {
621 DBG2(cerr <<
"Changing read_p state of " <<
name() <<
" to "
654 DBG2(cerr <<
"Calling BaseType::set_send_p() for: " << this->
name()
708 DBG(cerr <<
"In BaseType::transfer_attributes; processing " <<
name() << endl);
712 DBG(cerr <<
"Processing AttrTable: " << at->
get_name() << endl);
716 DBG(cerr <<
"About to append " <<
"attr name, type:" << at->
get_name(at_p) <<
", " << at->
get_type(at_p) << endl);
742 return d_in_selection;
757 d_in_selection = state;
772 if (!dynamic_cast<Constructor *>(parent)
773 && !dynamic_cast<Vector *>(parent)
775 throw InternalErr(
"Call to set_parent with incorrect variable type.");
854 throw InternalErr(__FILE__, __LINE__,
"BaseType::add_var unimplemented");
928 throw InternalErr(
"Unimplemented BaseType::read() method called for the variable named: " +
name());
935 DBG2(cerr <<
"BaseType::intern_data: " <<
name() << endl);
986 bool constraint_info,
bool constrained)
989 print_decl(oss, space, print_semi, constraint_info, constrained);
990 fwrite(oss.str().data(),
sizeof(char), oss.str().length(), out);
1037 bool constraint_info,
bool constrained)
1041 if (constrained && !
send_p())
1046 if (constraint_info) {
1048 out <<
": Send True" ;
1050 out <<
": Send False" ;
1096 if (constrained && !
send_p())
1102 if (!d_name.empty())
1103 if (xmlTextWriterWriteAttribute(xml.
get_writer(), (
const xmlChar*)
"name", (
const xmlChar*)d_name.c_str()) < 0)
1104 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1109 if (xmlTextWriterEndElement(xml.
get_writer()) < 0)
1155 bool sem = (d_type !=
dods_null_c && d_name.length());
1158 msg =
"Every variable must have both a name and a type\n";
1204 throw InternalErr(__FILE__, __LINE__,
"Unimplemented operator.");
1220 throw InternalErr(__FILE__, __LINE__,
"not implemented");
1222 return width(constrained);
std::vector< entry * >::iterator Attr_iter
virtual bool read()
Read data into a local buffer.
virtual bool read_p()
Has this variable been read?
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.
xmlTextWriterPtr get_writer()
virtual Attr_iter attr_end()
virtual void print_xml(FILE *out, string space=" ", bool constrained=false)
Part
Names the parts of multi-section constructor data types.
BaseType & operator=(const BaseType &rhs)
bool is_constructor_type(Type t)
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable...
Contains the attributes for a dataset.
virtual void set_name(const string &n)
Sets the name of the class instance.
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
virtual void print_xml_writer(XMLWriter &xml, bool constrained=false)
virtual BaseType * get_parent()
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
bool is_vector_type(Type t)
Returns true if the instance is a vector (i.e., array) type variable.
virtual void set_is_global_attribute(bool ga)
void print_xml_writer(XMLWriter &xml)
virtual void add_var(BaseType *bt, Part part=nil)
Add a variable.
Type
Identifies the data type.
Type type() const
Returns the type of the class instance.
virtual string get_name() const
Get the name of this attribute table.
virtual string toString()
virtual void set_in_selection(bool state)
virtual bool is_in_selection()
Is this variable part of the current selection?
stack< BaseType * > btp_stack
virtual void set_parent(BaseType *parent)
A class for software fault reporting.
virtual bool is_vector_type()
Returns true if the instance is a vector (i.e., array) type variable.
virtual bool is_constructor_type()
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable...
string dataset() const
Returns the name of the dataset used to create this instance.
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
string type_name() const
Returns the type of the class instance as a string.
virtual int element_count(bool leaves=false)
Count the members of constructor types.
virtual void set_send_p(bool state)
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
virtual void dump(ostream &strm) const
dumps information about this object
void set_type(const Type &t)
Sets the type of the class instance.
virtual void set_read_p(bool state)
Sets the value of the read_p property.
bool is_simple_type(Type t)
Returns true if the instance is a numeric, string or URL type variable.
virtual bool synthesized_p()
string name() const
Returns the name of the class instance.
virtual Attr_iter attr_begin()
string www2id(const string &in, const string &escape, const string &except)
void m_duplicate(const BaseType &bt)
Perform a deep copy.
Evaluate a constraint expression.
static ostream & LMarg(ostream &strm)
virtual AttrTable & get_attr_table()
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
The basic data type for the DODS DAP types.
libdap base object for common functionality of libdap objects
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
virtual void set_attr_table(const AttrTable &at)
virtual void dump(ostream &strm) const
dumps information about this object
virtual unsigned int width(bool constrained=false)
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
virtual bool is_simple_type()
Returns true if the instance is a numeric, string or URL type variable.
string type_name(Type t)
Returns the type of the class instance as a string.
virtual void transfer_attributes(AttrTable *at)
virtual bool send_p()
Should this variable be sent?
string id2www(string in, const string &allowable)
unsigned int get_doc_size()
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
virtual void set_synthesized_p(bool state)