本文整理汇总了C++中EList::addTail方法的典型用法代码示例。如果您正苦于以下问题:C++ EList::addTail方法的具体用法?C++ EList::addTail怎么用?C++ EList::addTail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EList
的用法示例。
在下文中一共展示了EList::addTail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWorkerName
void TaskManager::setWorkerName(RFSMtreenode* startnode, std::string workName, EList<std::string>& tlist)
{
std::vector<std::string> linkedTasks = startnode->getLinkedNodes();
if(linkedTasks.size()>0){
for(unsigned int i =0; i<linkedTasks.size();i++){
std::string tName = linkedTasks[i];
RFSMtreenode* t = m_taskMem->findBehavior(tName);
if(t == NULL){
t = m_taskMem->findConnector(tName);
}
if(t != NULL && !t->isReferred(workName)){
tlist.addTail(t->getName());
t->addRefTask(workName);
setWorkerName(t, workName, tlist);
}
}
}
}
示例2: unloadWorker
int TaskManager::unloadWorker(std::string workerName)
{
//먼저 실행 중이 task는 모두 삭제부터 한다.
stopAllWorker();
//worker목록 제거
/*
StrMap* taskTAB = m_taskMem->getTaskTAB();
StrMap::iterator it1 = taskTAB->find(workerName);
if(it1 != taskTAB->end()){
taskTAB->erase(it1);
}
else{
TaskTAB* taskTAB2 = m_taskMem->getTaskTAB2();
TaskTAB::iterator it2 = taskTAB2->find(workerName);
if(it2 != taskTAB2->end()){
delete it2->second;
taskTAB2->erase(it2);
}
else{
LOG_ERROR(m_log, "Task <%s> dose not exist in the loaded task list.", workerName.c_str());
return DB_UNLOAD_ERR_NO_WORKER;
}
}
*/
TaskTAB* taskTAB2 = m_taskMem->getTaskTAB2();
TaskTAB::iterator it2 = taskTAB2->find(workerName);
if(it2 != taskTAB2->end()){
delete it2->second;
taskTAB2->erase(it2);
}
else{
LOG_ERROR(m_log, "Task <%s> dose not exist in the loaded task list.", workerName.c_str());
return DB_UNLOAD_ERR_NO_WORKER;
}
//worker에서 이용하는 model(심볼테이블) 삭제
SymTAB* symTAB = m_taskMem->getSymbolTAB();
SymTAB::iterator it = m_taskMem->getSymbolTAB()->find(workerName);
if(it != symTAB->end()){
SymTAB4Task* symT = it->second;
if(symT->getWorkerRefCount() <= 1){
delete symT;
}
else{
symT->minRefCount();
}
symTAB->erase(it);
}
else{
LOG_ERROR(m_log, "The symbol table for task <%s> dose not exist", workerName.c_str());
return DB_UNLOAD_ERR_NO_SYMTAB;
}
//worker에 포함된 bhv 찾기
EList<std::string> delList;
BehaviorTAB* behaviorTAB = m_taskMem->getBehaviorTAB();
BehaviorTAB::iterator it3 = behaviorTAB->begin();
for(; it3!=behaviorTAB->end(); it3++){
RFSMbehavior* t = it3->second;
int wNum = t->unRefTask(workerName);
if(wNum == 0){//bhv를 이용하는 worker가 하나도 없으면
//unloadTask(it3->first); //map을 검색하면서 자신을 지우면 안된다.
delList.addTail(it3->first);
}
}
/*
if(delList.moveHead()){
do{
std::string tName = delList.getCurObject();
unloadBehavior(tName);
}
while(delList.moveNext());
}
*/
while(delList.moveHead()){
std::string tName = delList.getCurObject();
unloadBehavior(tName);
delList.delHead();
}
//m_taskMem->leakTest();
//conexer삭제
EList<std::string> delConList;
ConnectorTAB* conTAB = m_taskMem->getConnectorTAB();
ConnectorTAB::iterator it4 = conTAB->begin();
for(; it4!=conTAB->end(); it4++){
RFSMconnector* con = it4->second;
int wNum = con->unRefTask(workerName);
if(wNum == 0){//bhv를 이용하는 worker가 하나도 없으면
//unloadTask(it3->first); //map을 검색하면서 자신을 지우면 안된다.
delConList.addTail(it4->first);
}
}
while(delConList.getSize()>0 && delConList.moveHead()){
std::string cName = delConList.getCurObject();
unloadConnector(cName);
delConList.delHead();
//.........这里部分代码省略.........