⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 application.h

📁 拓扑查找算法的omnet仿真实现
💻 H
字号:
//-------------------------------------------------------------------//  file name: application.h// //    - header file for the application class//    - see the .cpp file for more details////-------------------------------------------------------------------#ifndef __APPLICATION_H#define __APPLICATION_H#include <omnetpp.h>#include "globaldef.h"#include <list>/** Main class on top of all the protocol stack. It contains user defined code  * as the top application or for debugging/testing the underlying layers  */class application : public cSimpleModule{    	/** omnet++ specific code */        Module_Class_Members(application,cSimpleModule,0);	/** the initialization function */	void initialize();	/** main loop function */	void handleMessage(cMessage *msg);	void finish();	// algorithm defined functions	void processTopologyRequest(cMessage *msg);		// process message of topology request	void processTopologyReply(cMessage *msg);		// process a topology reply message		void InitDataStruct();							// init the local data structure	void UpdateDataStruct(cMessage *msg);			// update the local data structure	void * AddDataStruct(cMessage *msg);			// returns a combined data structure	// data structures	std::list<int> nbrlist_nm1;		// n-1 list	std::list<int> nbrlist_n;		// n   list	std::list<int> nbrlist_np1;		// n+1 list	// number of hops away	int nhops;		// have we seen already the request?	bool seen_req;		// pointer to msg for reply timer	cMessage *msgtimerreply;	// local data struct	bool data[NNODES*NNODES];};Define_Module( application );#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -