当前位置: 首页>>代码示例>>C++>>正文


C++ FWObject::clearChildren方法代码示例

本文整理汇总了C++中FWObject::clearChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ FWObject::clearChildren方法的具体用法?C++ FWObject::clearChildren怎么用?C++ FWObject::clearChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FWObject的用法示例。


在下文中一共展示了FWObject::clearChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

bool PolicyCompiler::ConvertToAtomicForAddresses::processNext()
{
    PolicyRule *rule=getNext(); if (rule==NULL) return false;

    RuleElementSrc *src=rule->getSrc();    assert(src);
    RuleElementDst *dst=rule->getDst();    assert(dst);

    for (FWObject::iterator i1=src->begin(); i1!=src->end(); ++i1) {
	for (FWObject::iterator i2=dst->begin(); i2!=dst->end(); ++i2) {

	    PolicyRule *r = compiler->dbcopy->createPolicyRule();
	    r->duplicate(rule);
	    compiler->temp_ruleset->add(r);

	    FWObject *s;
	    s=r->getSrc();	assert(s);
	    s->clearChildren();
	    s->addCopyOf( *i1 );

	    s=r->getDst();	assert(s);
	    s->clearChildren();
	    s->addCopyOf( *i2 );

	    tmp_queue.push_back(r);
	}
    }
    return true;
}
开发者ID:BrendanThompson,项目名称:fwbuilder,代码行数:28,代码来源:PolicyCompiler.cpp

示例2: getDifference

Rule* PolicyCompiler::getDifference(PolicyRule &r1, PolicyRule &r2)
{
    PolicyRule *r = new PolicyRule();
    *r = r1;

    FWObject *nsrc = getFirstSrc(r);
    nsrc->clearChildren();

    FWObject *ndst = getFirstDst(r);
    ndst->clearChildren();

    Service  *nsrv = getFirstSrv(r);
    nsrv->clearChildren();

    RuleElementItf *intf_re = r1.getItf();
    FWObject *rule1_iface = FWObjectReference::getObject(intf_re->front());
    int iface1 = rule1_iface->getId();

    intf_re = r2.getItf();
    FWObject *rule2_iface = FWObjectReference::getObject(intf_re->front());
    int iface2 = rule2_iface->getId();

    if (iface1 != iface2) return r;

/*
    vector<FWObject*> v1=_substract_obj( r1.getSrc() , r2.getSrc() );
    vector<FWObject*> v2=_substract_obj( r1.getDst() , r2.getDst() );
    vector<FWObject*> v3=_substract_srv( r1.getSrv() , r2.getSrv() );

    for (vector<FWObject*>::iterator i=v1.begin(); i!=v1.end(); ++i)
	nsrc->addRef(*i);

    for (vector<FWObject*>::iterator i=v2.begin(); i!=v2.end(); ++i)
	ndst->addRef(*i);

    for (vector<FWObject*>::iterator i=v3.begin(); i!=v3.end(); ++i)
	nsrv->addRef(*i);
*/
    return r;
}
开发者ID:BrendanThompson,项目名称:fwbuilder,代码行数:40,代码来源:PolicyCompiler.cpp

示例3: if

bool RoutingCompiler::ConvertToAtomicForDST::processNext()
{
    RoutingRule *rule=getNext(); if (rule==NULL) return false;

    //RuleElementSrc *src=rule->getSrc();    assert(src);
    RuleElementRDst *dst=rule->getRDst();    assert(dst);

    for (FWObject::iterator it=dst->begin(); it!=dst->end(); ++it)
    {
        RoutingRule *r = compiler->dbcopy->createRoutingRule();
        r->duplicate(rule);
        compiler->temp_ruleset->add(r);

        FWObject *s = r->getRDst(); assert(s);
        s->clearChildren();
        s->addRef(FWReference::getObject(*it));

        tmp_queue.push_back(r);
    }

    return true;
}
开发者ID:BrendanThompson,项目名称:fwbuilder,代码行数:22,代码来源:RoutingCompiler.cpp


注:本文中的FWObject::clearChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。