您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ visitChildren函数代码示例

51自学网 2021-06-03 09:43:07
  C++
这篇教程C++ visitChildren函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中visitChildren函数的典型用法代码示例。如果您正苦于以下问题:C++ visitChildren函数的具体用法?C++ visitChildren怎么用?C++ visitChildren使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: ASSERT

void SlotVisitor::drain(){    StackStats::probe();    ASSERT(m_isInParallelMode);   #if ENABLE(PARALLEL_GC)    if (Options::numberOfGCMarkers() > 1) {        while (!m_stack.isEmpty()) {            m_stack.refill();            for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance(); m_stack.canRemoveLast() && countdown--;)                visitChildren(*this, m_stack.removeLast());            donateKnownParallel();        }                mergeOpaqueRootsIfNecessary();        return;    }#endif        while (!m_stack.isEmpty()) {        m_stack.refill();        while (m_stack.canRemoveLast())            visitChildren(*this, m_stack.removeLast());    }}
开发者ID:3163504123,项目名称:phantomjs,代码行数:25,


示例2: switch

void QSGNodeVisitor::visitNode(QSGNode *n){    switch (n->type()) {    case QSGNode::TransformNodeType: {        QSGTransformNode *t = static_cast<QSGTransformNode *>(n);        enterTransformNode(t);        visitChildren(t);        leaveTransformNode(t);        break; }    case QSGNode::GeometryNodeType: {        QSGGeometryNode *g = static_cast<QSGGeometryNode *>(n);        enterGeometryNode(g);        visitChildren(g);        leaveGeometryNode(g);        break; }    case QSGNode::ClipNodeType: {        QSGClipNode *c = static_cast<QSGClipNode *>(n);        enterClipNode(c);        visitChildren(c);        leaveClipNode(c);        break; }    case QSGNode::OpacityNodeType: {        QSGOpacityNode *o = static_cast<QSGOpacityNode *>(n);        enterOpacityNode(o);        visitChildren(o);        leaveOpacityNode(o);        break; }    default:        visitChildren(n);        break;    }}
开发者ID:OniLink,项目名称:Qt5-Rehost,代码行数:32,


示例3: qDebug

void QSGNodeUpdater::visitNode(QSGNode *n){#ifdef QSG_UPDATER_DEBUG    qDebug() << "enter:" << n;#endif    if (!n->dirtyFlags() && !m_force_update)        return;    if (n->isSubtreeBlocked())        return;    bool forceUpdate = n->dirtyFlags() & (QSGNode::DirtyNodeAdded | QSGNode::DirtyForceUpdate);    if (forceUpdate)        ++m_force_update;    switch (n->type()) {    case QSGNode::TransformNodeType: {        QSGTransformNode *t = static_cast<QSGTransformNode *>(n);        enterTransformNode(t);        visitChildren(t);        leaveTransformNode(t);        break; }    case QSGNode::GeometryNodeType: {        QSGGeometryNode *g = static_cast<QSGGeometryNode *>(n);        enterGeometryNode(g);        visitChildren(g);        leaveGeometryNode(g);        break; }    case QSGNode::ClipNodeType: {        QSGClipNode *c = static_cast<QSGClipNode *>(n);        enterClipNode(c);        visitChildren(c);        leaveClipNode(c);        break; }    case QSGNode::OpacityNodeType: {        QSGOpacityNode *o = static_cast<QSGOpacityNode *>(n);        enterOpacityNode(o);        visitChildren(o);        leaveOpacityNode(o);        break; }    default:        visitChildren(n);        break;    }    if (forceUpdate)        --m_force_update;    n->clearDirty();}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:50,


示例4: ASSERT

void MarkStack::drain(){#if !ASSERT_DISABLED    ASSERT(!m_isDraining);    m_isDraining = true;#endif    while (!m_markSets.isEmpty() || !m_values.isEmpty()) {        while (!m_markSets.isEmpty() && m_values.size() < 50) {            ASSERT(!m_markSets.isEmpty());            MarkSet& current = m_markSets.last();            ASSERT(current.m_values);            JSValue* end = current.m_end;            ASSERT(current.m_values);            ASSERT(current.m_values != end);        findNextUnmarkedNullValue:            ASSERT(current.m_values != end);            JSValue value = *current.m_values;            current.m_values++;            JSCell* cell;            if (!value || !value.isCell() || Heap::testAndSetMarked(cell = value.asCell())) {                if (current.m_values == end) {                    m_markSets.removeLast();                    continue;                }                goto findNextUnmarkedNullValue;            }            if (cell->structure()->typeInfo().type() < CompoundType) {                cell->JSCell::visitChildren(*this);                if (current.m_values == end) {                    m_markSets.removeLast();                    continue;                }                goto findNextUnmarkedNullValue;            }            if (current.m_values == end)                m_markSets.removeLast();            visitChildren(cell);        }        while (!m_values.isEmpty())            visitChildren(m_values.removeLast());    }#if !ASSERT_DISABLED    m_isDraining = false;#endif}
开发者ID:13W,项目名称:phantomjs,代码行数:49,


示例5: visitChildren

void cpt::semantics::PFTypeValidator::processBinaryArithmeticExpression(cdk::node::expression::BinaryExpression * const node, int lvl) {	visitChildren(node, lvl);	// Check for invalid types in expression	// FIXME: this is too long, better negate this...	if((node->left()->type()->name() == ExpressionType::TYPE_STRING)	|| (node->right()->type()->name() == ExpressionType::TYPE_STRING)	|| (node->left()->type()->name() == ExpressionType::TYPE_VOID)	|| (node->right()->type()->name() == ExpressionType::TYPE_VOID)	|| (node->left()->type()->name() == ExpressionType::TYPE_POINTER)	|| (node->right()->type()->name() == ExpressionType::TYPE_POINTER)	|| (node->left()->type()->name() == ExpressionType::TYPE_ERROR)	|| (node->right()->type()->name() == ExpressionType::TYPE_ERROR)) {		node->type(new ExpressionType(0, ExpressionType::TYPE_ERROR));	}	// If an operand is of type double, the binary expression is of type double	if((node->left()->type()->name() == ExpressionType::TYPE_DOUBLE)	|| (node->right()->type()->name() == ExpressionType::TYPE_DOUBLE)) {		node->type(new ExpressionType(8, ExpressionType::TYPE_DOUBLE));	}	// Otherwise, they are both integers, and the binary expression has type integer as well	else {		node->type(new ExpressionType(4, ExpressionType::TYPE_INT));	}}
开发者ID:AburameXIII,项目名称:mayfly-compiler,代码行数:27,


示例6: setNodeProperty

void CqParseTreeViz::Visit(IqParseNodeGatherConstruct& node){	setNodeProperty(node, "label", "GATHER");	setNodeProperty(node, "fillcolor", blockConstructColor);	setNodeProperty(node, "shape", "Msquare");	visitChildren(node);}
开发者ID:maya2renderer,项目名称:maya2renderer,代码行数:7,


示例7: index_std

void index_std(){    std::cout << "index_std=======================================================/n";    clang::index index;        std::vector<std::string> args = {"CC", "/home/nicholas/dev/cxxide/ex/stdlib-c++03.cpp"};    args.push_back("-I/usr/include/clang/3.0/include/");    auto& tu = index.parse_translation_unit(args);    std::cout << "parsed: " << tu.spelling() << "/n";        {        auto cursor = tu.get_cursor();                unsigned depth = 1;        std::function<CXChildVisitResult(const clang::cursor& cur, const clang::cursor& parent)> visitor = [&depth, &visitor](clang::cursor cur, clang::cursor parent) -> CXChildVisitResult        {            if(!cur.isUnexposed())            {                std::cout << std::string(depth, ' ') << cur.location() << " " << clang::to_string(cur.kind()) << " " << cur.spelling() << "/n";            }                        ++depth;            cur.visitChildren(visitor);            --depth;                        return CXChildVisit_Continue;        };        cursor.visitChildren(visitor);    }    std::cout << "index_std=======================================================/n";}
开发者ID:mythagel,项目名称:cxxide,代码行数:32,


示例8: scope

void SymbolCheckVisitor::visit(ASTFunction& ast){   ScopedScope scope(mScopeStack);   ScopedValue<ASTFunction*> scopedfunction(&mpFunction, &ast, mpFunction);   ASSERT_PTR(mpFunction);   visitChildren(ast); // <-- arguments   if ( ast.isConstructor() && ast.getName() != mpClass->getName() )   {      error(E0005, UTEXT("Function ") + ast.getName() + UTEXT(" must have a return type (or equal class name as constructor)."), ast);   }   if ( ast.hasBody() )   {      if ( ast.getModifiers().isAbstract() )      {         error(E0006, UTEXT("Abstract function ") + ast.getName() + UTEXT(" should not have a body."), ast);      }      else      {         checkReturn(ast);         ast.getBody().accept(*this);      }   }   else if ( !ast.getModifiers().isAbstract() && !ast.getModifiers().isPureNative() )   {      error(E0007, UTEXT("Function ") + ast.getName() + UTEXT(" requires a body."), ast);   }   mCurrentType.clear();}
开发者ID:crafter2d,项目名称:crafter2d,代码行数:33,


示例9: visitChildren

void SymbolCheckVisitor::visit(ASTUnary& ast){   visitChildren(ast);   checkOperator(ast, ast.getPre());   checkOperator(ast, ast.getPost());}
开发者ID:crafter2d,项目名称:crafter2d,代码行数:7,


示例10: assert

void CallTranslator::VisitStmt(const clang::Stmt *s) {    // Insert braces around all if and for statement bodies    if (const clang::CallExpr *call = clang::dyn_cast<clang::CallExpr>(s)) {        const clang::FunctionDecl *callee = call->getDirectCallee();        if (callee) {            std::string callee_name = callee->getNameAsString();            assert(callee_name.size() > 0);            std::string replace_with;            if (curr_func_is_quick == YES &&                    is_quick_transformed(callee_name)) {                replace_with = callee_name + "_quick";            } else if (curr_func_is_npm == YES) {                if (ignorable->find(callee_name) != ignorable->end()) {                    /*                     * Skip this function, we know it is an externally defined                     * function that won't create a checkpoint.                     */                } else if (is_npm_transformed(callee_name)) {                    /*                     * There is a local NPM version of this function defined in                     * the same compilation unit. We can simply reference it                     * directly.                     */                    replace_with = callee_name + "_npm";                } else {                    /*                     * We need to reference an externally defined NPM function                     * through a function pointer.                     */                    std::string varname = get_external_func_name(                            callee_name);                    replace_with = ("(*" + varname + ")");                }            }            if (replace_with.size() > 0) {                std::stringstream ss;                ss << replace_with << "(";                for (int i = 0; i < call->getNumArgs(); i++) {                    if (i != 0) ss << ", ";                    ss << to_string(call->getArg(i));                }                ss << ")";                rewriter->ReplaceText(clang::SourceRange(                            call->getLocStart(), call->getLocEnd()),                        ss.str());            }        }    }    visitChildren(s);}
开发者ID:agrippa,项目名称:chimes,代码行数:56,


示例11: visitIfExists

void visitIfExists(CDGNode * node, CDGNode * nodes[], int size) {  int i;  for (i = 0; i < size; i++) {    if (getID(node) == getID(nodes[i])) {      visitChildren(node, getOutcome(nodes[i]));      return;    }  }  return;}
开发者ID:rajshukla,项目名称:Testgen_Release-_Feb-15,代码行数:10,


示例12: ASSERT

void SlotVisitor::drain(){    ASSERT(m_isInParallelMode);       while (!m_stack.isEmpty()) {        m_stack.refill();        for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance(); m_stack.canRemoveLast() && countdown--;)            visitChildren(m_stack.removeLast());        donateKnownParallel();    }        mergeOpaqueRootsIfNecessary();}
开发者ID:llelectronics,项目名称:lls-qtwebkit,代码行数:13,


示例13: visitNamedNodeMap

void DOMWriter::visitElement(Element * node){  out << '<' << node->getNodeName();  visitNamedNodeMap(node->getAttributes());  if (node->hasChildNodes()) {    out << '>';    visitChildren(node->getChildNodes());    out << '<' << '/' << node->getNodeName() << '>';  }  else {    out << '/' << '>';  }}
开发者ID:CaptEmulation,项目名称:svgl,代码行数:14,


示例14: ASSERT

void SlotVisitor::drain(MonotonicTime timeout){    ASSERT(m_isInParallelMode);       while ((!m_collectorStack.isEmpty() || !m_mutatorStack.isEmpty()) && !hasElapsed(timeout)) {        if (!m_collectorStack.isEmpty()) {            m_collectorStack.refill();            m_isVisitingMutatorStack = false;            for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance(); m_collectorStack.canRemoveLast() && countdown--;)                visitChildren(m_collectorStack.removeLast());        } else if (!m_mutatorStack.isEmpty()) {            m_mutatorStack.refill();            // We know for sure that we are visiting objects because of the barrier, not because of            // marking. Marking will visit an object exactly once. The barrier will visit it            // possibly many times, and always after it was already marked.            m_isVisitingMutatorStack = true;            for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance(); m_mutatorStack.canRemoveLast() && countdown--;)                visitChildren(m_mutatorStack.removeLast());        }        donateKnownParallel();    }        mergeOpaqueRootsIfNecessary();}
开发者ID:ollie314,项目名称:webkit,代码行数:24,


示例15: visitChildren

bool TreeModel::romoveChildren(const QModelIndex &index){    bool success = true;    QList<qint64> ids;    visitChildren(index, ids);    foreach( qint64 id, ids)    {        bool ret = m_queryItem->removeRecord(id);        if( !ret )        {            success = false;            break;        }    }
开发者ID:newdebug,项目名称:NewDebug,代码行数:15,



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


C++ visitNode函数代码示例
C++ visit函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。