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


C++ EList::addTail方法代码示例

本文整理汇总了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);
			}
		}
	}
}
开发者ID:OPRoS,项目名称:TaskEngine,代码行数:19,代码来源:TaskManager.cpp

示例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();
//.........这里部分代码省略.........
开发者ID:OPRoS,项目名称:TaskEngine,代码行数:101,代码来源:TaskManager.cpp


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