43 #include "InternalErr.h"
67 Vars_iter p = bt->var_begin();
68 while (p != bt->var_end()) {
75 BaseType::set_send_p(bt->send_p());
98 for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) {
99 if ((*iter)->send_p())
100 i += (*iter)->element_count(
true);
109 BESDEBUG(
"ascii",
" In AsciiSequence::print_ascii_row" << endl);
111 Sequence *seq = dynamic_cast < Sequence * >(
_redirect);
118 bool first_var =
true;
121 BaseType *bt_ptr = seq->var_value(row, j);
124 if (abt_ptr->type() == dods_sequence_c) {
125 if (abt_ptr->send_p()) {
138 outer_vars.push_back(bt_ptr);
139 if (abt_ptr->send_p()) {
155 }
while (j < elements);
161 BESDEBUG(
"ascii",
" In AsciiSequence::print_leading_vars" << endl);
163 bool first_var =
true;
164 BaseTypeRow::iterator BTR_iter = outer_vars.begin();
165 while (BTR_iter != outer_vars.end()) {
177 BESDEBUG(
"ascii",
" Out AsciiSequence::print_leading_vars" << endl);
183 Sequence *seq = dynamic_cast < Sequence * >(
_redirect);
187 const int rows = seq->number_of_rows() - 1;
191 if (i > 0 && !outer_vars.empty())
202 BESDEBUG(
"ascii",
" Out AsciiSequence::print_ascii_rows" << endl);
208 bool first_var =
true;
209 Vars_iter p = var_begin();
210 while (p != var_end())
212 if ((*p)->send_p()) {
218 if ((*p)->is_simple_type())
219 strm << dynamic_cast<AsciiOutput *> (*p)->get_full_name();
220 else if ((*p)->type() == dods_sequence_c)
221 dynamic_cast<AsciiSequence *> ((*p))->
print_header(strm);
222 else if ((*p)->type() == dods_structure_c)
223 dynamic_cast<AsciiStructure *> ((*p))->
print_header(strm);
228 "This method should only be called by instances for which `is_simple_sequence' returns true.");
239 BESDEBUG(
"ascii",
"In AsciiSequence::print_ascii" << endl);
240 Sequence *seq = dynamic_cast < Sequence * >(_redirect);
244 if (seq->is_linear()) {
250 BaseTypeRow outer_vars(0);
251 print_ascii_rows(strm, outer_vars);
254 const int rows = seq->number_of_rows() - 1;
255 const int elements = seq->element_count() - 1;
258 bool rows_done =
false;
262 bool vars_done =
false;
265 BaseType *bt_ptr = seq->var_value(i, j++);
267 dynamic_cast <
AsciiOutput * >(abt_ptr)->print_ascii(strm,
276 }
while (!vars_done);
283 }
while (!rows_done);
virtual int element_count(bool leaves=false)
virtual BaseType * ptr_duplicate()
AsciiSequence(const string &n)
virtual int length() const
virtual void print_leading_vars(ostream &strm, BaseTypeRow &outer_vars)
virtual void print_header(ostream &strm)
virtual void print_ascii(ostream &strm, bool print_name)
Print an ASCII representation for an instance of BaseType's children.
virtual void print_ascii_rows(ostream &strm, BaseTypeRow out_vars)
BaseType * basetype_to_asciitype(BaseType *bt)
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
virtual void print_ascii_row(ostream &strm, int row, BaseTypeRow out_vars)