next up previous contents
Next: Complete Listing of the Up: The Graph Class: Previous: A Sample Application:

The Public Interface: nodes() and edges()

The final agents in the Graph class are public interfaces to allow the user to view the interior of the class.

const GnodePtrBag& Graph::nodes() const{return d_nodes;}
const GedgePtrBag& Graph::edges() const{return d_edges;}

These are references to the GnodePtrBag and GedgePtrBag members of the Graph class. That is they return the d_nodes and d_edges contents of the Graph. As the nodes() and edges() are constant, they may not be modified by the user. Thus, there is no danger of unwanted or mistaken modification.



Jim Peterson
1999-05-17