// Returns only the result from the LAST vertex iterated over AstNUser* iterateInEdges(GateGraphBaseVisitor& v, AstNUser* vup=NULL) { AstNUser* retp = NULL; for (V3GraphEdge* edgep = inBeginp(); edgep; edgep = edgep->inNextp()) { retp = dynamic_cast<GateEitherVertex*>(edgep->fromp())->accept(v, vup); } return retp; }
void V3GraphVertex::rerouteEdges(V3Graph* graphp) { // Make new edges for each from/to pair for (V3GraphEdge* iedgep = inBeginp(); iedgep; iedgep=iedgep->inNextp()) { for (V3GraphEdge* oedgep = outBeginp(); oedgep; oedgep=oedgep->outNextp()) { new V3GraphEdge (graphp, iedgep->fromp(), oedgep->top(), min(iedgep->weight(),oedgep->weight()), iedgep->cutable() && oedgep->cutable()); } } // Remove old edges unlinkEdges(graphp); }
void V3GraphVertex::unlinkEdges(V3Graph* graphp) { for (V3GraphEdge* edgep = outBeginp(); edgep; /*BELOW*/) { V3GraphEdge* nextp = edgep->outNextp(); edgep->unlinkDelete(); edgep = nextp; } for (V3GraphEdge* edgep = inBeginp(); edgep; /*BELOW*/) { V3GraphEdge* nextp = edgep->inNextp(); edgep->unlinkDelete(); edgep = nextp; } }
bool V3GraphVertex::inSize1() const { return !inEmpty() && inBeginp()->inNextp()==NULL; }