本文整理汇总了C++中EList::moveNext方法的典型用法代码示例。如果您正苦于以下问题:C++ EList::moveNext方法的具体用法?C++ EList::moveNext怎么用?C++ EList::moveNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EList
的用法示例。
在下文中一共展示了EList::moveNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadWorker
int TaskManager::loadWorker(std::string workerFileName, OSFileSys* fsys)
{
int result = 0;
int errorCount = 0;
std::auto_ptr<EParser> aTest(new EParser(m_ostr));
//EParser* aTest = new EParser(m_ostr);
aTest->setFilename(workerFileName);
int res = aTest->extractInclude(workerFileName, TaskConfig::getDeployHome());
if(res != 0){
result = res;
errorCount = res;
}
if(aTest->getInclude() != 0){
//preprocessing include
EList<std::string> includedFiles = aTest->getInclude()->getIncludeFiles();
if(includedFiles.moveHead()){
do{
std::string fName = includedFiles.getCurObject();
//parsing
LOG_TRACE(m_log, "Reading the file, '%s'...", fName.c_str());
aTest->setFilename(fName);
errorCount = aTest->parseScript(TaskConfig::getDeployHome() + fName);
if(errorCount>0){
result = errorCount; ///////////////////////////////////에러코드정리
LOG_ERROR(m_log, "Parser can not open the file '%s'.", fName.c_str());
break;
}
}
while(includedFiles.moveNext());
}
}
if(errorCount == 0){
GparsedResult* pRslt = aTest->getParsingResult();
EList<Genum*>* enumlist = pRslt->getEnums();
EList<Gmodel*>* modellist = pRslt->getModels();
EList<Gaction*>* actionlist = pRslt->getActions();
// EList<Gworker*>* workerlist = pRslt->getWorkers(); //예전 방법 task 정의
EList<Gtask*>* tasklist = pRslt->getTasks(); //최근 방법 task 정의
EList<Gbehavior*>* bhvlist = pRslt->getbehaviors();
EList<Gconnector*>* connlist = pRslt->getconnectors();
SymTAB4Task* newSymT = new SymTAB4Task();
std::auto_ptr<RTObjBuilder> rtmBuilder(new RTObjBuilder(m_ostr, newSymT));
//RTObjBuilder *rtmBuilder = new RTObjBuilder(m_ostr, newSymT);
EList<RFSMtask*>* rtasks = NULL;
EList<RFSMbehavior*>* rbhvs = NULL;
EList<RFSMconnector*>* rconns = NULL;
try{
//model, action, enum 검사
LOG_TRACE(m_log, "Checking Model composed of Symbol, Function, Action and Enum ...");
rtmBuilder->makeSymTable(pRslt);
//TASK 명세 검사
LOG_TRACE(m_log, "Checking Tasks ...");
rtasks = rtmBuilder->checkSemantics(tasklist);
rbhvs = rtmBuilder->checkSemantics(bhvlist);
rconns = rtmBuilder->checkSemantics(connlist);
//Model 파일수가 여러개 이더라도 1개의 심볼테이블이 만들어진다.
//파일이 나누어져도 하나의 파일로 간주
//SymTAB4Task* newSymT = rtmBuilder->getSymT();
/*
if(workerlist !=NULL && workerlist->getSize()>0 && workerlist->moveHead()){
do{
Gworker* worker = workerlist->getCurObject();
std::string workerName = worker->getName()->getData();
//Task 들을 등록
result = m_taskMem->addTask(workerName, worker->getStartBhv()->getData());
//심볼테이블 등록
if(result ==0){
newSymT->pluRefCount();
result = m_taskMem->addSymbolT(workerName, newSymT);
}
else
result = 100; ///////////////////////////////////에러코드정리
}
while(workerlist->moveNext());
}
*/
if(rtasks !=NULL && rtasks->getSize()>0 && rtasks->moveHead()){
do{
RFSMtask* task = rtasks->getCurObject();
std::string taskName = task->getName();
//Task 들을 등록
result = m_taskMem->addTask2(taskName, task);
//여기까지 했다 다음부터 구현 할 것
//.........这里部分代码省略.........
示例2: getDot
std::string TaskManager::getDot(std::string workerName, RFSMtreenode* startNode, EList<std::string> tlist)
{
RFSMbehavior* startTask = (RFSMbehavior*)startNode;
if(typeid(*startNode)==typeid(RFSMbehavior)){
}
else if(typeid(*startNode)==typeid(RFSMconnector)){
return "";
}
else{
return "";
}
std::string dot;
dot.append("digraph G{\n");
dot.append("compound=true;\n");
// 1.Pre declaration
if(tlist.getSize()>0 && tlist.moveHead()){
do{
dot.append("subgraph cluster");//RFSMtask에서 이름앞에 'cluster'를 사용
dot.append(tlist.getCurObject());
dot.append(";\n");
}
while(tlist.moveNext());
}
// 2. worker의 시작 bhv
dot.append(startTask->getDot());
// 3. worker의 시작 Task에서 분기되는 Task들
std::vector<std::string> linkedTasks = startTask->getLinkedNodes();
if(linkedTasks.size()>0){
for(unsigned int i =0; i<linkedTasks.size();i++){
std::string tName = linkedTasks[i];
RFSMbehavior* t = m_taskMem->findBehavior(tName);
if(t != NULL){
std::string taskDot = t->getDot();
dot.append(taskDot);
}
}
}
// 4. %taskname%을 initial state 명으로 바꾼다.
while(true){
int s = dot.find_first_of("%");
int e = dot.find_first_of("*");
if(s<0 || e<0)break;
std::string sub = dot.substr(s, e-s+1);//시작, 시작으로부터offset
std::string stName = dot.substr(s+1, e-s-1);
RFSMbehavior* tt = m_taskMem->findBehavior(stName);
if(tt != NULL && tt->getInitialState() != NULL){
std::string isName = tt->getInitialState()->getName();
Estring::replaceAll(dot, sub, RFSMnamedItem::removePath(isName));
}
else{
//무한루프를 빠져나오기 위해서 bhv가 없더라도 반드시 %,*가 없는 이름으로 변환
Estring::replaceAll(dot, sub, stName);
}
}
dot.append("}\n");
return dot;
}