application.h

来自「拓扑查找算法的omnet仿真实现」· C头文件 代码 · 共 66 行

H
66
字号
//-------------------------------------------------------------------//  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 + =
减小字号Ctrl + -
显示快捷键?