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


C++ ModelData::getRelatedFuncInterfaceClasses方法代码示例

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


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

示例1: getRelatedNodesRecurse

void ClassGraph::getRelatedNodesRecurse(const ModelData &model, const ModelType *type,
        eAddNodeTypes addType, int maxDepth, std::vector<ClassNode> &nodes)
    {
    mBackgroundTaskLevel++;
    -- maxDepth;
    if(maxDepth >= 0 && type /* && type->getObjectType() == otClass*/)
        {
        const ModelClassifier *classifier = type->getClass();
        if(classifier)
            {
            addNodeToVector(ClassNode(classifier,
                    getComponentOptions(*type, mGraphOptions)), nodes);
            if((addType & AN_MemberChildren) > 0)
                {
                for(const auto &attr : classifier->getAttributes())
                    {
#if(DEBUG_ADD)
                    DebugAdd("Member", attr->getDeclType());
#endif
                    getRelatedNodesRecurse(model, attr->getDeclType(), addType,
                            maxDepth, nodes);
                    }
                }
            if((addType & AN_Superclass) > 0)
                {
                for(const auto &assoc : model.mAssociations)
                    {
                    if(assoc->getChild() != nullptr && assoc->getParent() != nullptr)
                        {
                        if(assoc->getChild() == classifier)
                            {
#if(DEBUG_ADD)
                            DebugAdd("Super", assoc->getParent());
#endif
                            getRelatedNodesRecurse(model, assoc->getParent(),
                                    addType, maxDepth, nodes);
                            }
                        }
                    }
                }
            if((addType & AN_Subclass) > 0)
                {
                for(const auto &assoc  : model.mAssociations)
                    {
                    // Normally the child and parent should not be nullptr.
                    if(assoc->getChild() != nullptr && assoc->getParent() != nullptr)
                        {
                        if(assoc->getParent() == classifier)
                            {
#if(DEBUG_ADD)
                            DebugAdd("Subclass", assoc->getChild());
#endif
                            getRelatedNodesRecurse(model, assoc->getChild(),
                                    addType, maxDepth, nodes);
                            }
                        }
                    }
                }
            if((addType & AN_FuncParamsUsing) > 0)
                {
                ConstModelClassifierVector relatedClasses;
                model.getRelatedFuncInterfaceClasses(*classifier, relatedClasses);
                for(const auto &cls : relatedClasses)
                    {
#if(DEBUG_ADD)
                    DebugAdd("Param Using", cls);
#endif
                    getRelatedNodesRecurse(model, cls, addType, maxDepth, nodes);
                    }
                }
            if((addType & AN_FuncBodyUsing) > 0)
                {
                ConstModelDeclClasses relatedDeclClasses;
                model.getRelatedBodyVarClasses(*classifier, relatedDeclClasses);
                for(const auto &rdc : relatedDeclClasses)
                    {
#if(DEBUG_ADD)
                    DebugAdd("Body Using", rdc.cl);
#endif
                    getRelatedNodesRecurse(model, rdc.getClass(), addType,
                            maxDepth, nodes);
                    }
                }
            }
        if((addType & AN_Templates) > 0)
            {
            if(type->isTemplateUseType())
                {
                // Add types pointed to by templates.
                ConstModelClassifierVector relatedClassifiers;
                model.getRelatedTypeArgClasses(*type, relatedClassifiers);
                for(const auto &rc : relatedClassifiers)
                    {
#if(DEBUG_ADD)
                DebugAdd("Templ User", rc);
#endif
                    getRelatedNodesRecurse(model, rc, addType, maxDepth, nodes);
                    }
                addNodeToVector(ClassNode(type,
                        getComponentOptions(*type, mGraphOptions)), nodes);
//.........这里部分代码省略.........
开发者ID:8l,项目名称:oovcde,代码行数:101,代码来源:ClassGraph.cpp

示例2: addRelatedNodesRecurseUserToVector

void ClassGraph::addRelatedNodesRecurseUserToVector(const ModelData &model,
        const ModelType *type, const ModelType *modelType, eAddNodeTypes addType,
        int maxDepth, std::vector<ClassNode> &nodes)
    {
    // Add nodes for template types if they refer to the passed in type.
    if((addType & AN_Templates) > 0)
        {
        if(modelType->isTemplateUseType())
            {
            ConstModelClassifierVector relatedClassifiers;
            model.getRelatedTypeArgClasses(*modelType, relatedClassifiers);
            for(const auto &rc : relatedClassifiers)
                {
                if(rc == type)
                    {
#if(DEBUG_ADD)
                DebugAdd("Typedef Rel", modelType);
#endif
                    getRelatedNodesRecurse(model, modelType, addType, maxDepth,
                            nodes);
                    }
                }
            }
        }
    // Add nodes if members refer to the passed in type.
    if((addType & AN_MemberUsers) > 0)
        {
        const ModelClassifier*cl = modelType->getClass();
        if(cl)
            {
            for(const auto &attr : cl->getAttributes())
                {
                const ModelType *attrType = attr->getDeclType();
                if(attrType == type)
                    {
#if(DEBUG_ADD)
                    DebugAdd("Memb User", cl);
#endif
                    getRelatedNodesRecurse(model, cl, addType, maxDepth, nodes);
                    }
                }
            }
        }
    // Add nodes if func params refer to the passed in type.
    if((addType & AN_FuncParamsUsers) > 0)
        {
        const ModelClassifier*cl = modelType->getClass();
        if(cl)
            {
            ConstModelClassifierVector relatedClasses;
            model.getRelatedFuncInterfaceClasses(*cl, relatedClasses);
            for(auto &cls : relatedClasses)
                {
                if(cls == type)
                    {
#if(DEBUG_ADD)
                    DebugAdd("Param User", cl);
#endif
                    getRelatedNodesRecurse(model, cl, addType, maxDepth, nodes);
                    }
                }
            }
        }
    // Add nodes if func body variables refer to the passed in type.
    if((addType & AN_FuncBodyUsers) > 0)
        {
        const ModelClassifier*cl = modelType->getClass();
        if(cl)
            {
            ConstModelDeclClasses relatedDeclClasses;
            model.getRelatedBodyVarClasses(*cl, relatedDeclClasses);
            for(auto &rdc : relatedDeclClasses)
                {
                if(rdc.getClass() == type)
                    {
#if(DEBUG_ADD)
                    DebugAdd("Var User", cl);
#endif
                    getRelatedNodesRecurse(model, cl, addType, maxDepth, nodes);
                    }
                }
            }
        }
    }
开发者ID:8l,项目名称:oovcde,代码行数:84,代码来源:ClassGraph.cpp


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