82 DBG(cerr <<
"Copying structure: " <<
name() << endl);
84 for (
Vars_iter i = cs.d_vars.begin(); i != cs.d_vars.end(); i++) {
85 DBG(cerr <<
"Copying field: " << (*i)->name() << endl);
91 BaseType *btp = (*i)->ptr_duplicate();
92 btp->set_parent(
this);
132 delete btp ; btp = 0;
164 i += (*j)->element_count(leaves);
177 linear = linear && static_cast<Structure*>((*i))->
is_linear();
179 linear = linear && (*i)->is_simple_type();
190 (*i)->set_send_p(state);
200 (*i)->set_read_p(state);
216 (*i)->set_in_selection(state);
228 static_cast<Sequence&>(**i).set_leaf_sequence(++level);
230 static_cast<Structure&>(**i).set_leaf_sequence(level);
245 throw InternalErr(__FILE__, __LINE__,
"The BaseType parameter cannot be null.");
247 if (bt->is_dap4_only_type())
248 throw InternalErr(__FILE__, __LINE__,
"Attempt to add a DAP4 type to a DAP2 Structure.");
268 throw InternalErr(__FILE__, __LINE__,
"The BaseType parameter cannot be null.");
270 if (bt->is_dap4_only_type())
271 throw InternalErr(__FILE__, __LINE__,
"Attempt to add a DAP4 type to a DAP2 Structure.");
273 bt->set_parent(
this);
285 if ((*i)->name() == n) {
341 sz += (*i)->width(constrained);
344 sz += (*i)->width(constrained);
356 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
361 if ((*i)->send_p()) {
362 (*i)->intern_data(eval, dds);
369 Marshaller &m,
bool ce_eval)
377 if (ce_eval && !eval.eval_selection(dds,
dataset()))
384 if ((*i)->send_p()) {
386 XDRStreamMarshaller *sm =
dynamic_cast<XDRStreamMarshaller*
>(&m);
388 sm->reset_checksum();
390 (*i)->serialize(eval, dds, m,
false);
395 (*i)->serialize(eval, dds, m,
false);
407 (*i)->deserialize(um, dds, reuse);
441 Structure::var(
const string &name,
bool exact_match, btp_stack *s)
471 if ((*i)->name() ==
name) {
473 DBG(cerr <<
"Pushing " << this->
name() << endl);
474 s->push(static_cast<BaseType *>(
this));
478 if ((*i)->is_constructor_type()) {
479 BaseType *btp = (*i)->var(name,
false, s);
482 DBG(cerr <<
"Pushing " << this->
name() << endl);
483 s->push(static_cast<BaseType *>(
this));
501 if ((*i)->name() ==
name) {
503 s->push(static_cast<BaseType *>(
this));
511 string::size_type dot_pos = name.find(
".");
512 if (dot_pos != string::npos) {
513 string aggregate = name.substr(0, dot_pos);
514 string field = name.substr(dot_pos + 1);
519 s->push(static_cast<BaseType *>(
this));
521 return agg_ptr->var(field,
true, s);
538 fwrite(oss.str().data(),
sizeof(char), oss.str().length(), out);
551 i++, (void)(i !=
d_vars.end() && out <<
", ")) {
552 (*i)->print_val(out,
"",
false);
577 if (!(*i)->check_semantics(msg,
true)) {
601 << (
void *)
this <<
")" << endl ;