51 BaseType *this_btp = dynamic_cast < BaseType * >(
this);
52 BaseType *btp = _redirect;
56 throw InternalErr(__FILE__, __LINE__,
57 "Instance of AsciiOuput must also be a BaseType.");
59 BaseType *btp2 = this_btp->get_parent();
63 return dynamic_cast <
AsciiOutput * >(btp2)->get_full_name()
74 bool print_name)
throw(InternalErr)
76 BaseType *BTptr = _redirect;
78 BTptr = dynamic_cast < BaseType * >(
this);
82 throw InternalErr(__FILE__, __LINE__,
83 "An instance of AsciiOutput failed to cast to BaseType.");
86 strm << get_full_name() <<
", " ;
88 BTptr->print_val(strm,
"",
false);
99 const vector < int >&shape)
102 DBG(cerr <<
"Entering increment_state" << endl);
104 vector < int >::reverse_iterator state_riter;
105 vector < int >::const_reverse_iterator shape_riter;
106 for (state_riter = state->rbegin(), shape_riter = shape.rbegin();
107 state_riter < state->rend(); state_riter++, shape_riter++) {
108 if (*state_riter == *shape_riter - 1) {
111 *state_riter = *state_riter + 1;
113 DBG(cerr <<
"Returning state:";
114 for_each(state->begin(), state->end(), print < int >);
121 DBG(cerr <<
"Returning state without change:";
122 for_each(state->begin(), state->end(), print < int >);
bool increment_state(vector< int > *state, const vector< int > &shape)
Increment #state# to the next value given #shape#.
virtual void print_ascii(ostream &strm, bool print_name=true)
Print an ASCII representation for an instance of BaseType's children.
string get_full_name()
Get the fully qualified name of this object.