本文整理汇总了C++中DataStream::addProcess方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStream::addProcess方法的具体用法?C++ DataStream::addProcess怎么用?C++ DataStream::addProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStream
的用法示例。
在下文中一共展示了DataStream::addProcess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addGraphNode
int ProcessGraph::addGraphNode(ProcessGraphNode *pgn){
nodes[numNodes]=pgn;
inverse[pgn->getVarDecl()]=numNodes;
//std::cout << "adaugat graph node\n";
clang::CallExpr *e=dyn_cast<clang::CallExpr>(pgn->getExpr());
clang::DeclRefExpr *fun = getProcessFunction(e->getArg(1));
clang::FunctionDecl *funD = dyn_cast<clang::FunctionDecl>(fun->getDecl());
//if (funD!=NULL)
// std::cout << "gasit decl\n";
pgn->setName(funD->getNameAsString());
std::cout << "adaugat "<<pgn->getName() << std::endl;
pgn->setNumber(numNodes);
int numP = funD->getNumParams();
for (int i=3; i<3+numP; i++){
clang::ParmVarDecl *pvd = funD->getParamDecl(i-3);
if (pvd->getType().getAsString().compare("co_stream")==0){
clang::DeclRefExpr *str_ref = getProcessFunction(e->getArg(i));
if (!dyn_cast<clang::VarDecl>(str_ref->getDecl())){
std::cerr << "error: not referencing a variabile in call to co_process_create\n";
exit(-1);
}
int str_id = inverse[dyn_cast<clang::VarDecl>(str_ref->getDecl())];
DataStream *ds = vertices[str_id];
/*
if (ds==NULL)
std::cout<<"ds null";
*/
ds->addProcess(pgn);
pgn->addStream(ds);
std::cout << "added stream " << ds->getVarDecl()->getNameAsString() << "\n";
}
}
numNodes++;
return numNodes-1;
}