示例#1
0
PathItem PathTree::pathItem(Segment::PtrConst p) {
    Segment::PtrConst retSeg = seg(p->returnSegment());
    PathItem pI;
    pI.loc = loc(retSeg->source());
    pI.seg = p ;
    pI.returnSeg = seg(p->returnSegment());
    return pI;
}
示例#2
0
void Conn::onSegmentDel(Segment::PtrConst seg0){
    FWK_DEBUG("Conn::onSegmentDel() with name: " << seg0->name());
    if (graphSegment_.find(seg0->name()) == graphSegment_.end()){
        FWK_DEBUG("Conn::onSegmentDel() did not find any segment called "
            << seg0->name() << " in the graph");
        return;
    }
    removeGraphSegment(seg0);
    if (seg0->returnSegment() != "")
        removeGraphSegment(graphSegment_[seg0->returnSegment()]);
};
示例#3
0
void Conn::onSegmentUpdate(Segment::PtrConst seg0) {
    FWK_DEBUG("Conn::onSegmentUpdate() with name: " << seg0->name());
    if (graphSegment_.find(seg0->name()) == graphSegment_.end()){
        FWK_DEBUG("Conn::onSegmentUpdate() did not find any segment called "
            << seg0->name() << " in the graph");
        if (isInsertable(seg0) == insertable_){
            Segment::PtrConst seg1 = 
                owner_->entityManager()->segment(seg0->returnSegment());
            FWK_DEBUG("Conn::onSegmentUpdate() Adding " << 
                seg0->name() << " to graph");
            graphSegment_[seg0->name()] = seg0;
            FWK_DEBUG("Conn::onSegmentUpdate() Adding " <<
                seg1->name() << " to graph");
            graphSegment_[seg1->name()] = seg1;
            if (graphLocation_.find(seg0->source()) == graphLocation_.end()) {
                Location::PtrConst loc0 =
                    owner_->entityManager()->location(seg0->source());
                FWK_DEBUG("Conn::onSegmentUpdate() Adding " << 
                    loc0->name() << " to graph");
                graphLocation_[loc0->name()] = loc0;
                routeTable_->statusIs(RouteTable::needsUpdate);
            }
            if (graphLocation_.find(seg1->source()) == graphLocation_.end()){
                Location::PtrConst loc1 = 
                    owner_->entityManager()->location(seg1->source());
                FWK_DEBUG("Conn::onSegmentUpdate() Adding " <<
                    loc1->name() << " to graph");
                graphLocation_[loc1->name()] = loc1;
                routeTable_->statusIs(RouteTable::needsUpdate);
            }
        } else {
            FWK_DEBUG("Conn::onSegmentUpdate() " << seg0->name() <<
                " is not insertable");
            return;
        }
    }
    if (seg0->source() == ""){
        removeGraphSegment(seg0);
        removeGraphSegment(graphSegment_[seg0->returnSegment()]);
    }
    if (seg0->returnSegment() == ""){
        removeGraphSegment(seg0);
    }
};
示例#4
0
Conn::Insertable Conn::isInsertable(Segment::PtrConst seg){
    FWK_DEBUG("Conn::isInsertable() with name: " << seg->name());
    if (!owner_->entityManager()->segment(seg->returnSegment())){
        FWK_DEBUG("Conn::isInsertable() Missing Return");
        return missingReturn_;
    }
    if (!owner_->entityManager()->location(seg->source())){
        FWK_DEBUG("Conn::isInsertable() Missing Source");
        return missingSource_;
    }
    if (!owner_->entityManager()->location(
        owner_->entityManager()->segment(
        seg->returnSegment())->source())) {
            FWK_DEBUG("Conn::isInsertable() Missing Return Source");
            return missingReturnSource_;
    }
    FWK_DEBUG("Conn::isInsertable() Insertable");
    return insertable_;
};