cppAddNeighbors.pp

UseCase3



// Iterate through the edge list, adding each as a neighbor to the list of
// adjacencies in the CDG object. The actual function call used depends on
// the edge type. Just pass the vertex name and leave it up to the CDG 
// object to implement the addition.

// This must be done after to cppAddSourceVertices.

*operation* void cppAddNeighbors(Cd_Graph* cdg)
   *traverse*
      *from* Graph
      *through* -> *,edges,*
      *to* { ConstEdge, AltEdge }
   *wrapper* ConstEdge
      (@
         cdg->cdgAddCNeighbor(this->get_from()->GetVName(),
                              this->GetCEName(), 
                              this->get_to()->GetVName());
      @)
   *wrapper* AltEdge
      (@
         cdg->cdgAddANeighbor(this->get_from()->GetVName(),
                              this->get_to()->GetVName());
      @)