本文整理汇总了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;
}
示例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;
}
示例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;
}