69 DBG(cerr <<
"Copying structure: " <<
name() << endl);
72 DBG(cerr <<
"Copying field: " << (*i)->name() << endl);
117 delete btp ; btp = 0;
148 j += (*j)->element_count(leaves);
160 linear = linear && dynamic_cast<Structure*>((*i))->
is_linear();
162 linear = linear && (*i)->is_simple_type();
172 (*i)->set_send_p(state);
182 (*i)->set_read_p(state);
197 (*i)->set_in_selection(state);
209 dynamic_cast<Sequence&>(**i).set_leaf_sequence(++level);
211 dynamic_cast<Structure&>(**i).set_leaf_sequence(level);
226 "The BaseType parameter cannot be null.");
235 _vars.push_back(btp);
249 "The BaseType parameter cannot be null.");
263 if ((*i)->name() == n) {
319 sz += (*i)->width(constrained);
322 sz += (*i)->width(constrained);
333 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
338 if ((*i)->send_p()) {
339 (*i)->intern_data(eval, dds);
361 if ((*i)->send_p()) {
362 (*i)->serialize(eval, dds, m,
false);
373 (*i)->deserialize(um, dds, reuse);
409 return m_exact_match(n, s);
411 return m_leaf_match(n, s);
420 BaseType *btp = m_exact_match(name, &s);
424 return m_leaf_match(name, &s);
430 Structure::m_leaf_match(
const string &name, btp_stack *s)
433 if ((*i)->name() ==
name) {
435 DBG(cerr <<
"Pushing " << this->
name() << endl);
436 s->push(static_cast<BaseType *>(
this));
440 if ((*i)->is_constructor_type()) {
441 BaseType *btp = (*i)->var(name,
false, s);
444 DBG(cerr <<
"Pushing " << this->
name() << endl);
445 s->push(static_cast<BaseType *>(
this));
457 Structure::m_exact_match(
const string &name, btp_stack *s)
460 DBG(cerr <<
"Looking at " << (*i)->name() <<
" in: " << *i
462 if ((*i)->name() ==
name) {
463 DBG(cerr <<
"Found " << (*i)->name() <<
" in: "
466 DBG(cerr <<
"Pushing " << this->
name() << endl);
467 s->push(static_cast<BaseType *>(
this));
473 string::size_type dot_pos = name.find(
".");
474 if (dot_pos != string::npos) {
475 string aggregate = name.substr(0, dot_pos);
476 string field = name.substr(dot_pos + 1);
480 DBG(cerr <<
"Descending into " << agg_ptr->name() << endl);
482 DBG(cerr <<
"Pushing " << this->
name() << endl);
483 s->push(static_cast<BaseType *>(
this));
485 return agg_ptr->var(field,
true, s);
500 fprintf(out,
" = ") ;
505 i++, (void)(i !=
_vars.end() && fprintf(out,
", "))) {
506 (*i)->print_val(out,
"",
false);
512 fprintf(out,
";\n") ;
526 i++, (void)(i !=
_vars.end() && out <<
", ")) {
527 (*i)->print_val(out,
"",
false);
550 if (!(*i)->check_semantics(msg,
true)) {
573 << (
void *)
this <<
")" << endl ;