本文整理汇总了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;
}
示例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;
}