next up previous contents
Next: The Constructor/ Destructor: Up: The Source: charsllist.c Previous: The Source: charsllist.c

Overloaded Input and Output for Operators:

Note that these operators call the print and grab agents in order to have access to protected elements of the CHAR_CELL_CORE children. They are first implemented in the class CHAR_CELL_CORE as follows:

    // ************************************************** //
    // overload the output operator for CHAR_CELL_CORE    //
    // ************************************************** //
ostream& operator<<(ostream& output,const CHAR_CELL_CORE& A)
{
  A.print(output);
  return(output);
}
    // ********************************************************* //
    // overload the output operator for CHAR_CELL_CORE*   //
    // ********************************************************* //
ostream& operator<<(ostream& output,const CHAR_CELL_CORE* A)
{
  A->print(output);
  return(output);
}

Of course, the print and grab methods are virtual at this point, so they will use the print and grab methods built in the children.



Jim Peterson
1999-04-22