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


C++ TaskManager::join方法代码示例

本文整理汇总了C++中TaskManager::join方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskManager::join方法的具体用法?C++ TaskManager::join怎么用?C++ TaskManager::join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TaskManager的用法示例。


在下文中一共展示了TaskManager::join方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char ** argv){


	NodeType type;
	if(strcmp(argv[1],"sink")==0){
		type = SINK;
	}
	if(strcmp(argv[1],"camera")==0){
		type = CAMERA;
	}
	if(strcmp(argv[1],"cooperator")==0){
		type = COOPERATOR;
	}

	NodeManager *nodeMng;
	RadioSystem *radioSys;
	TaskManager *taskMng;
	S2GInterface *s2ginterface;
	MessageParser *msg_parser;
	//ConnectionManager *connMng;
	boost::asio::io_service io_service;

	switch(type){
	case SINK:{
		//create the main components
		nodeMng  = new NodeManager(SINK, argv[6]);
		msg_parser = new MessageParser();
		radioSys = new RadioSystem(nodeMng, msg_parser,argv[3],argv[4],argv[5]);
		taskMng  = new TaskManager(nodeMng);


		nodeMng->set_radioSystem(radioSys);
		nodeMng->set_taskManager(taskMng);

		//start the task manager
		taskMng->start();

		//start a telosb receiver
		radioSys->startTelosbReceiver(argv[2], argv[6]);

		//start the sink2gui interface
		tcp::resolver resolver(io_service);
		tcp::resolver::query query("localhost", "1234");
		tcp::resolver::iterator iterator = resolver.resolve(query);
		s2ginterface = new S2GInterface(nodeMng, msg_parser, io_service, iterator);
		s2ginterface->startInterface();
		nodeMng->set_s2gInterface(s2ginterface);



		break;
	}
	case CAMERA:{
		nodeMng  = new NodeManager(CAMERA, argv[6]);
		msg_parser = new MessageParser();
		radioSys = new RadioSystem(nodeMng,msg_parser,argv[3],argv[4],argv[5]);

		
		taskMng  = new TaskManager(nodeMng);
		//connMng = new ConnectionManager();

		nodeMng->set_radioSystem(radioSys);
		nodeMng->set_taskManager(taskMng);

		//start the task manager
		taskMng->start();

		//start a telosb receiver
		radioSys->startTelosbReceiver(argv[2], argv[6]);

		//start the WiFi manager
		radioSys->startWiFiReceiver();


		radioSys->joinTelosbReceiver();
		break;
	}
	case COOPERATOR:{
		nodeMng  = new NodeManager(COOPERATOR,argv[6]);
		msg_parser = new MessageParser();
		radioSys = new RadioSystem(nodeMng,msg_parser,argv[3],argv[4],argv[5]);
		taskMng  = new TaskManager(nodeMng);

		nodeMng->set_radioSystem(radioSys);
		nodeMng->set_taskManager(taskMng);


		//start the task manager
		taskMng->start();
		
		radioSys->startWiFiReceiver(); //ALEXIS 15/12 WIFI CLASS
		
		break;
	}
	default:

		break;
	}


//.........这里部分代码省略.........
开发者ID:alejandroguillen,项目名称:testbed_final,代码行数:101,代码来源:example.cpp


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