本文整理汇总了C++中TNode::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ TNode::addChild方法的具体用法?C++ TNode::addChild怎么用?C++ TNode::addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNode
的用法示例。
在下文中一共展示了TNode::addChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popOperator
void Parser::popOperator(Operator op) {
string nodeName = "";
if(op.value == "+") {
nodeName = "PLUS_NODE";
} else if(op.value == "-") {
nodeName = "MINUS_NODE";
} else if(op.value == "*") {
nodeName = "TIMES_NODE";
}
TNode* operatorNode = new TNode(nodeName, op.value, line, currentProc);
TNode* rightOperand = operandStack.top(); operandStack.pop();
TNode* leftOperand = operandStack.top(); operandStack.pop();
operatorNode->addChild(leftOperand);
operatorNode->addChild(rightOperand);
operatorStack.pop();
operandStack.push(operatorNode);
postfix += " " + op.value;
}
示例2: popOperator
void Parser::popOperator(Operator op) {
TNode operatorNode = TNode(TNODE_NAMES[PLUS_NODE], "+", loc, 0);
TNode* rightOperand = operandStack.top(); operandStack.pop();
TNode* leftOperand = operandStack.top(); operandStack.pop();
operatorNode.addChild(leftOperand);
operatorNode.addChild(rightOperand);
operatorStack.pop();
operandStack.push(&operatorNode);
expressionPostfix += " +";
}
示例3: insertSubItem
ULONG VorticalLayerCtrl::insertSubItem(ULONG nItem)
{
TNode* pNode = m_pRoot->getAt(nItem);
if (pNode != NULL)
{
setVirtualSizeCached(FALSE);
pNode->addChild(SPTNode(new TNode));
if (pNode->isExpanded())
{
CacheInfo chinfo(pNode->getMyLayer() + 1, TRUE);
WFX_CONDITION(nItem + 1 <= m_rgCacheInfo.size());
m_rgCacheInfo.insert(m_rgCacheInfo.begin() + nItem + 1, chinfo);
}
}
return m_rgCacheInfo.size();
}