70 DBG(cerr <<
"Copying structure: " <<
name() << endl);
73 DBG(cerr <<
"Copying field: " << (*i)->name() << endl);
118 delete btp ; btp = 0;
149 j += (*j)->element_count(leaves);
161 linear = linear && dynamic_cast<Structure*>((*i))->
is_linear();
163 linear = linear && (*i)->is_simple_type();
173 (*i)->set_send_p(state);
183 (*i)->set_read_p(state);
198 (*i)->set_in_selection(state);
210 dynamic_cast<Sequence&>(**i).set_leaf_sequence(++level);
212 dynamic_cast<Structure&>(**i).set_leaf_sequence(level);
227 "The BaseType parameter cannot be null.");
236 _vars.push_back(btp);
250 "The BaseType parameter cannot be null.");
264 if ((*i)->name() == n) {
320 sz += (*i)->width(constrained);
323 sz += (*i)->width(constrained);
334 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
339 if ((*i)->send_p()) {
340 (*i)->intern_data(eval, dds);
362 if ((*i)->send_p()) {
368 (*i)->serialize(eval, dds, sm,
false);
371 cerr << (*i)->name() <<
": " << sm.
get_checksum() << endl;
373 (*i)->serialize(eval, dds, m,
false);
385 (*i)->deserialize(um, dds, reuse);
421 return m_exact_match(n, s);
423 return m_leaf_match(n, s);
432 BaseType *btp = m_exact_match(name, &s);
436 return m_leaf_match(name, &s);
442 Structure::m_leaf_match(
const string &name, btp_stack *s)
445 if ((*i)->name() ==
name) {
447 DBG(cerr <<
"Pushing " << this->
name() << endl);
448 s->push(static_cast<BaseType *>(
this));
452 if ((*i)->is_constructor_type()) {
453 BaseType *btp = (*i)->var(name,
false, s);
456 DBG(cerr <<
"Pushing " << this->
name() << endl);
457 s->push(static_cast<BaseType *>(
this));
469 Structure::m_exact_match(
const string &name, btp_stack *s)
472 DBG(cerr <<
"Looking at " << (*i)->name() <<
" in: " << *i
474 if ((*i)->name() ==
name) {
475 DBG(cerr <<
"Found " << (*i)->name() <<
" in: "
478 DBG(cerr <<
"Pushing " << this->
name() << endl);
479 s->push(static_cast<BaseType *>(
this));
485 string::size_type dot_pos = name.find(
".");
486 if (dot_pos != string::npos) {
487 string aggregate = name.substr(0, dot_pos);
488 string field = name.substr(dot_pos + 1);
492 DBG(cerr <<
"Descending into " << agg_ptr->name() << endl);
494 DBG(cerr <<
"Pushing " << this->
name() << endl);
495 s->push(static_cast<BaseType *>(
this));
497 return agg_ptr->var(field,
true, s);
512 fprintf(out,
" = ") ;
517 i++, (void)(i !=
_vars.end() && fprintf(out,
", "))) {
518 (*i)->print_val(out,
"",
false);
524 fprintf(out,
";\n") ;
538 i++, (void)(i !=
_vars.end() && out <<
", ")) {
539 (*i)->print_val(out,
"",
false);
562 if (!(*i)->check_semantics(msg,
true)) {
585 << (
void *)
this <<
")" << endl ;