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.