//////////////////////////////////////////////////////////////////////// // $Log: checkInheritanceRestriction.pp,v $ // Revision 5.5.1.5 1994/09/21 15:44:53 demeter // *** empty log message *** // // Revision 5.5.1.4 1994/09/21 14:31:42 demeter // initial // //////////////////////////////////////////////////////////////////////// *operation* void checkInheritanceRestriction(Propagation_schema *ps) *wrapper* Cd_graph *prefix* (@ ps->get_paths()->get_adjacencies()->checkInheritanceRestriction( ps->get_paths()->get_adjacencies(),ps); @) *operation* void checkInheritanceRestriction(Adjacency_Nlist* adjs, Propagation_schema* ps) *wrapper* Adjacency_Nlist *prefix* (@ Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) each->checkInheritanceRestriction(adjs,ps); @) *wrapper* Adjacency *prefix* (@ ns->checkInheritanceRestriction(adjs,ps,source,superclasses); @) *operation* void checkInheritanceRestriction(Adjacency_Nlist* adjs, Propagation_schema* ps, Vertex* s, Vertex_List* supers) *wrapper* Neighbors *prefix* (@ @) *wrapper* Neighbors_wc *prefix* (@ @) *wrapper* Alternat_ns *prefix* (@ if ((supers && supers->list_length()) || (this->get_construct_ns()->list_length())) { int hasInhEdge = 0; int isTarget = 0; adjs->hasIncomingInheritanceEdge(s,hasInhEdge); ps->get_target_port()->contains(s,isTarget); if (!hasInhEdge && !isTarget) { cout << toolname << ": the Inheritance Restriction violated. " << "Abstract class " << s->get_vertex_name() << " has outgoing construction/inheritance edges but does not have any incoming inheritance edges.\n\n" << "Propagation graph:\n" << ps << endl; exit(-1); } } @) *operation* void hasIncomingInheritanceEdge(Vertex* v, int& r) *wrapper* Adjacency_Nlist *prefix* (@ Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) { each->hasIncomingInheritanceEdge(v,r); if (r) return; } @) *wrapper* Adjacency *prefix* (@ Vertex_list_iterator next(*superclasses); Vertex* each; while (each = next()) if (v->equal(each)) { r = 1; return; } @)