#include "semcheck.h" void Cd_graph::AddOneEdge(Vertex* owner,Vertex* borrower) { adjacencies->AddOneEdge(owner,borrower); } void Adjacency_Nlist::AddOneEdge(Vertex* owner,Vertex* borrower) { Adjacency_list_iterator next(*this); Adjacency_ each; while (each = next()) if (each->get_source()->g_equal(owner)) break; if (each==NULL) { Adjacency_ new_adj = new Adjacency(); new_adj->set_source(owner); Construct_ns* cons_n = new Construct_ns(); cons_n->set_construct_ns(new Any_vertex_List()); new_adj->set_ns(cons_n); this->append(new_adj); each = new_adj; } each->AddOneEdge(borrower); } void Adjacency::AddOneEdge(Vertex* borrower) { ns->AddOneEdge(borrower); } void Neighbors::AddOneEdge(Vertex* borrower) { } void Neighbors_wc::AddOneEdge(Vertex* borrower) { Any_vertex_list_iterator next(*this->get_construct_ns()); Any_vertex_ each; while (each = next()) { if ((((Regular*)each)->get_vertex()) ->get_vertex()->g_equal(borrower)) return; } Regular * new_regular = new Regular(); Normal * new_Normal = new Normal(); new_Normal->set_vertex(borrower); new_regular->set_vertex(new_Normal); this->get_construct_ns()->append(new_regular); }