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


C++ Procedure::isExternal方法代码示例

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


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

示例1: Procedure

map<string, Procedure*>* IRWriter::writeProcedures(map<string, Procedure*>* procs){
    map<string, Procedure*>::iterator it;
    map<string, Procedure*>* newProcs = new map<string, Procedure*>();


    //Creation of procedure must be done in two times because function can call other functions
    for (it = procs->begin(); it != procs->end(); ++it){
        Procedure* proc = (*it).second;
        Function* newFunction = NULL;

        //Write declaration of the function
        if (proc->isExternal()){
            newFunction = writer->addFunctionProtosExternal(proc->getFunction());
        }else{
            newFunction = writer->addFunctionProtosInternal(proc->getFunction());
        }

        //Create a new procedure
        Procedure* newProc = new Procedure(proc->getName(), proc->getExternal(), newFunction);
        newProcs->insert(pair<string, Procedure*>(proc->getName(), newProc));
    }

    //Link body of the procedure
    for (it = procs->begin(); it != procs->end(); ++it){
        Procedure* proc = (*it).second;
        writer->linkProcedureBody(proc->getFunction());
    }

    return newProcs;
}
开发者ID:orcc,项目名称:jade,代码行数:30,代码来源:IRWriter.cpp

示例2:

list<Procedure*> Decoder::getExternalProcs(){
    list<Procedure*> externs;

    // Look across all instances for external procedures
    map<std::string, Instance*>* instances = configuration->getInstances();
    for (map<std::string, Instance*>::iterator it = instances->begin(); it != instances->end(); it++){
        Instance* instance = it->second;

        // Look accross all procs for external property
        map<string, Procedure*>::iterator itProc;
        map<string, Procedure*>* procs = instance->getProcs();

        for (itProc = procs->begin(); itProc != procs->end(); itProc++){
            Procedure* proc = itProc->second;

            if (proc->isExternal()){
                externs.push_back(proc);
            }

        }
    }

    return externs;
}
开发者ID:orcc,项目名称:jade,代码行数:24,代码来源:Decoder.cpp


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