cppDelAEdge

UseCase2



*operation* int cppDelAEdge( char* SrcLabelname, char* DesLabelname )
   *init* (@ 0 @)
   *traverse*
      *from* Graph
         *through* -> *,edges,*
      *to*   { AltEdge, ConstEdge }

   *carry*
      *in* Edge_List* new_EList = (@ new Edge_List() @)
      *along* *from* Graph *through* -> *,edges,* *to* { AltEdge, ConstEdge }

   *wrapper* Graph
      *suffix*
      (@
         delete (this -> get_edges());
         this -> set_edges(new_EList);

         this -> cppDrawVertices();
         this -> cppDrawEdges();
      @)

   *wrapper* ConstEdge
      (@
         new_EList -> append(this);
      @)

   *wrapper* AltEdge
      (@
         DemIdent* srcVname = this->get_from()->get_vertexname()->get_name();
         DemIdent* desVname = this->get_to()->get_vertexname()->get_name();

         if(!strcmp(SrcLabelname, srcVname->get_val()) &&
            !strcmp(DesLabelname, desVname->get_val())) {

           if(this->get_middlepoints() != NULL) {
             delete(this->get_middlepoints()->get_coords());
             delete(this->get_middlepoints());
           }
           delete (this);

           return_val = 1;

         } else {

           new_EList -> append(this);

         }
      @)