cdgAddSourceAVertex

UseCase3



// Create a new adjacency with a source vertex of the given name
// and an empty neighbor list of type Cd_Alternat.  Add it to 
// the current Cd_Adj_List.

*operation* void cdgAddSourceAVertex(DemIdent* name)
  *traverse* *from* Cd_Graph *to* Cd_Adj_List
   *wrapper* Cd_Adj_List
      (@
         Cd_Adjacency* NewAdj = new Cd_Adjacency();
         Cd_Vertex* NewVertex = new Cd_Vertex(name);
         Cd_Alternat *NewAlternat = new Cd_Alternat(new Cd_V_BarList());

         NewAlternat->set_construct_ns(new Cd_LV_List());

         NewAdj->set_source(NewVertex);
         NewAdj->set_ns(NewAlternat);                                                  
         this->append(NewAdj);
      @)