82 DBG2(cerr <<
"BaseType::_duplicate: " << bt._name <<
" send_p: "
83 << bt._send_p << endl);
86 _dataset = bt._dataset;
89 d_in_selection = bt.d_in_selection;
90 _synthesized_p = bt._synthesized_p;
92 d_parent = bt.d_parent;
110 BaseType::BaseType(
const string &n,
const Type &t)
111 : _name(n), _type(t), _dataset(
""), _read_p(false), _send_p(false),
112 d_in_selection(false), _synthesized_p(false), d_parent(0)
129 : _name(n), _type(t), _dataset(d), _read_p(false), _send_p(false),
130 d_in_selection(false), _synthesized_p(false), d_parent(0)
141 DBG2(cerr <<
"Entering ~BaseType (" <<
this <<
")" << endl);
142 DBG2(cerr <<
"Exiting ~BaseType" << endl);
164 oss <<
"BaseType (" <<
this <<
"):" << endl
165 <<
" _name: " << _name << endl
167 <<
" _dataset: " << _dataset << endl
168 <<
" _read_p: " << _read_p << endl
169 <<
" _send_p: " << _send_p << endl
170 <<
" _synthesized_p: " << _synthesized_p << endl
171 <<
" d_parent: " << d_parent << endl
172 <<
" d_attr: " << hex << &d_attr << dec << endl;
189 << (
void *)
this <<
")" << endl ;
256 return string(
"Null");
258 return string(
"Byte");
260 return string(
"Int16");
262 return string(
"UInt16");
264 return string(
"Int32");
266 return string(
"UInt32");
268 return string(
"Float32");
270 return string(
"Float64");
272 return string(
"String");
274 return string(
"Url");
276 return string(
"Array");
278 return string(
"Structure");
280 return string(
"Sequence");
282 return string(
"Grid");
284 cerr <<
"BaseType::type_name: Undefined type" << endl;
418 return _synthesized_p;
429 _synthesized_p = state;
485 if (! _synthesized_p) {
486 DBG2(cerr <<
"Changing read_p state of " <<
name() <<
" to "
519 DBG2(cerr <<
"Calling BaseType::set_send_p() for: " << this->
name()
573 DBG(cerr <<
"In BaseType::transfer_attributes; processing " <<
name() << endl);
577 DBG(cerr <<
"Processing AttrTable: " << at->
get_name() << endl);
581 DBG(cerr <<
"About to append " <<
"attr name, type:" << at->
get_name(at_p) <<
", " << at->
get_type(at_p) << endl);
607 return d_in_selection;
622 d_in_selection = state;
637 if (!dynamic_cast<Constructor *>(parent)
638 && !dynamic_cast<Vector *>(parent)
640 throw InternalErr(
"Call to set_parent with incorrect variable type.");
719 throw InternalErr(__FILE__, __LINE__,
"BaseType::add_var unimplemented");
793 throw InternalErr(
"Unimplemented BaseType::read() method called for the variable named: " +
name());
800 DBG2(cerr <<
"BaseType::intern_data: " <<
name() << endl);
852 bool constraint_info,
bool constrained)
856 if (constrained && !
send_p())
859 fprintf(out,
"%s%s %s", space.c_str(),
type_name().c_str(),
862 if (constraint_info) {
864 fprintf(out,
": Send True") ;
866 fprintf(out,
": Send False") ;
870 fprintf(out,
";\n") ;
918 bool constraint_info,
bool constrained)
922 if (constrained && !
send_p())
927 if (constraint_info) {
929 out <<
": Send True" ;
931 out <<
": Send False" ;
949 if (constrained && !
send_p())
952 fprintf(out,
"%s<%s", space.c_str(),
type_name().c_str());
954 fprintf(out,
" name=\"%s\"",
id2xml(_name).c_str());
960 fprintf(out,
"%s</%s>\n", space.c_str(),
type_name().c_str());
963 fprintf(out,
"/>\n");
978 if (constrained && !
send_p())
983 out <<
" name=\"" <<
id2xml(_name) <<
"\"" ;
989 out << space <<
"</" <<
type_name() <<
">\n" ;
1005 if (constrained && !
send_p())
1012 if (xmlTextWriterWriteAttribute(xml.
get_writer(), (
const xmlChar*)
"name", (
const xmlChar*)_name.c_str()) < 0)
1013 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1018 if (xmlTextWriterEndElement(xml.
get_writer()) < 0)
1065 bool sem = (_type !=
dods_null_c && _name.length());
1068 msg =
"Every variable must have both a name and a type\n";
1114 throw InternalErr(__FILE__, __LINE__,
"Unimplemented operator.");