82 DBG(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 DBG(cerr <<
"Entering ~BaseType (" <<
this <<
")" << endl);
142 DBG(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 DBG(cerr <<
"Changing read_p state of " <<
name() <<
" to "
519 DBG(cerr <<
"Calling BaseType::set_send_p() for: " << this->
name()
575 DBG(cerr <<
"In BaseType::transfer_attributes; processing " <<
name() << endl);
579 DBG(cerr <<
"Processing AttrTable: " << at->
get_name() << endl);
583 DBG(cerr <<
"About to append " << endl);
584 DBG(cerr <<
"attr name,type:" << at->
get_name(at_p) <<
", " << at->
get_type(at_p) << endl);
612 return d_in_selection;
627 d_in_selection = state;
640 if (!dynamic_cast<Constructor *>(parent)
641 && !dynamic_cast<Vector *>(parent))
642 throw InternalErr(
"Call to set_parent with incorrect variable type.");
721 throw InternalErr(__FILE__, __LINE__,
"BaseType::add_var unimplemented");
795 throw InternalErr(
"Unimplemented BaseType::read() method called.");
802 DBG(cerr <<
"BaseType::intern_data: " <<
name() << endl);
854 bool constraint_info,
bool constrained)
858 if (constrained && !
send_p())
861 fprintf(out,
"%s%s %s", space.c_str(),
type_name().c_str(),
864 if (constraint_info) {
866 fprintf(out,
": Send True") ;
868 fprintf(out,
": Send False") ;
872 fprintf(out,
";\n") ;
920 bool constraint_info,
bool constrained)
924 if (constrained && !
send_p())
929 if (constraint_info) {
931 out <<
": Send True" ;
933 out <<
": Send False" ;
950 if (constrained && !
send_p())
953 fprintf(out,
"%s<%s", space.c_str(),
type_name().c_str());
955 fprintf(out,
" name=\"%s\"",
id2xml(_name).c_str());
961 fprintf(out,
"%s</%s>\n", space.c_str(),
type_name().c_str());
964 fprintf(out,
"/>\n");
978 if (constrained && !
send_p())
983 out <<
" name=\"" <<
id2xml(_name) <<
"\"" ;
989 out << space <<
"</" <<
type_name() <<
">\n" ;
1038 bool sem = (_type !=
dods_null_c && _name.length());
1041 msg =
"Every variable must have both a name and a type\n";
1087 throw InternalErr(__FILE__, __LINE__,
"Unimplemented operator.");