本文整理汇总了C++中SNode::order方法的典型用法代码示例。如果您正苦于以下问题:C++ SNode::order方法的具体用法?C++ SNode::order怎么用?C++ SNode::order使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SNode
的用法示例。
在下文中一共展示了SNode::order方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: childTopDown
/** first
0 - FALSE - call to handel nodes with next priority / order
1 - TRUE (default) - first call for this object
*/
bool INode::childTopDown(bool first)
{
#ifdef DEBUGMSG
qDebug("# INode::childTopDown (%s) cont_td (this %p) first: %d", (const char *) name(), this, first);
qDebug("##(xxx) INode::childTopDown (%s) (this %p) #childcount %d, ordercount %d, aktivorder %d, aktivcount %d, truncation %d",
(const char *) name(), this, childcount_,ordercount_,aktivorder_,aktivcount_,truncation());
#endif
SNode *el; // hilfspointer
if (first) {// first call of 'childTopDown' for this object
childList_ = &(sNode_->children()); // liste der subknoten erzeugen
childcount_ = childList_->count(); // anzahl aller (noch) zu bearbeitenden knoten
aktivorder_=-1; // prioritaet der zu bearbeitenden nodes
if (childcount_ == 0) { //no sub nodes
aktivcount_ = 0;
execBottomUp(); //execState(BU);// BottomUp
return 0;
}
} else { // recursiv call of 'childTopDown' for this object
if (aktivcount_ > 0 || ordercount_ > 0 ) return 1;
if (childcount_ <= 0) return 0;//all sub nodes are handled
if (truncation()) return 0; //all sub nodes are handelt or node is trash
}
//Praemisse (ordercount_ == 0) && (childcount_ > 0)
while (ordercount_ == 0) {
aktivorder_ ++;
for (el = childList_->first(); el != 0; el = childList_->next())
if(el->order() == aktivorder_) ordercount_++; // anzahl der nodes der aktuellen prioritaet
}
#ifdef DEBUGMSG
qDebug("## INode::childTopDown (%s) (this %p) #childs %d, ordercount %d, aktivorder %d, aktivcount_ %d",
(const char *) name(), this, childcount_, ordercount_, aktivorder_,aktivcount_);
#endif
INode *inode;
for (el = childList_->first(); el != 0; el = childList_->next()) {
if (truncation()) { //bedingungen nicht mehr erfüllt
aktivcount_ = 0;
execBottomUp(); //execState(BU);// BottomUp
return 0;
}
if (el->order() == aktivorder_) {
incrementCount(); //einer mehr in der queue -> siehe decrementCount()
childcount_--; ordercount_--; //aktuelle wird gleich bearbeitet
inode = new INode(el); //new INode
CHECK_PTR(inode);
inode->status(HI);
inode->execState(TD);
childLink(inode); // remount node in the tree
inode->execTopDown(); //start topdown operator
//childcount_--; ordercount_--; //aktuelle wird gleich bearbeitet
//!MP25.07.2001 inode might be deleted
//! analysis_->nodeChange(inode); //info to the rest of the world
analysis_->nodeChange(0);
}
}
return 1;
}