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);
245 if ((*i)->name() == n) {
288 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
293 if ((*i)->send_p()) {
294 (*i)->intern_data(eval, dds);
316 if ((*i)->send_p()) {
317 (*i)->serialize(eval, dds, m,
false);
328 (*i)->deserialize(um, dds, reuse);
364 return m_exact_match(n, s);
366 return m_leaf_match(n, s);
375 BaseType *btp = m_exact_match(name, &s);
379 return m_leaf_match(name, &s);
385 Structure::m_leaf_match(
const string &name, btp_stack *s)
388 if ((*i)->name() ==
name) {
390 DBG(cerr <<
"Pushing " << this->
name() << endl);
391 s->push(static_cast<BaseType *>(
this));
395 if ((*i)->is_constructor_type()) {
396 BaseType *btp = (*i)->var(name,
false, s);
399 DBG(cerr <<
"Pushing " << this->
name() << endl);
400 s->push(static_cast<BaseType *>(
this));
412 Structure::m_exact_match(
const string &name, btp_stack *s)
415 DBG(cerr <<
"Looking at " << (*i)->name() <<
" in: " << *i
417 if ((*i)->name() ==
name) {
418 DBG(cerr <<
"Found " << (*i)->name() <<
" in: "
421 DBG(cerr <<
"Pushing " << this->
name() << endl);
422 s->push(static_cast<BaseType *>(
this));
428 string::size_type dot_pos = name.find(
".");
429 if (dot_pos != string::npos) {
430 string aggregate = name.substr(0, dot_pos);
431 string field = name.substr(dot_pos + 1);
435 DBG(cerr <<
"Descending into " << agg_ptr->name() << endl);
437 DBG(cerr <<
"Pushing " << this->
name() << endl);
438 s->push(static_cast<BaseType *>(
this));
440 return agg_ptr->var(field,
true, s);
455 fprintf(out,
" = ") ;
460 i++, (void)(i !=
_vars.end() && fprintf(out,
", "))) {
461 (*i)->print_val(out,
"",
false);
467 fprintf(out,
";\n") ;
481 i++, (void)(i !=
_vars.end() && out <<
", ")) {
482 (*i)->print_val(out,
"",
false);
505 if (!(*i)->check_semantics(msg,
true)) {
528 << (
void *)
this <<
")" << endl ;