mac.h

来自「OMNET++仿真三色算法的源码,三色算法是无线传感器中一个典型的分簇算法」· C头文件 代码 · 共 77 行

H
77
字号
#ifndef MAC_H#define MAC_H#include "omnetpp.h"#include "costants.h"
#include "log.h"//buffer for the incoming messages.//Used to implement the mm1 queue of messages//toward the routing moduleclass cBuffer : public cObject{    public:        //the total size of the buffer	double capacity;		//the amount of used space	double used;	cQueue* queue;	cBuffer(double);	~cBuffer();	//return true if the size of the	//object to store does fit in the remaining	//room in the buffer	bool canStore(int);	//self expalinig...	bool empty();	bool insert(cMessage*);		int  length();		cMessage* pop();	};class SimpleMac : public cSimpleModule{   private:	//if false only the messages with correct MAC address will pass	//this level upward	bool promisqueMode;	//decide how long a message will wait	double elabTime(cMessage*);		//...	bool routerBusy;		//self message used to handle the mm1 queue toward	//the routig module	cMessage* endService;	//input message buffer	cBuffer* buffer;	   public:	//Macro that contains the costructor,destructor	//and other Omnett++ stuff	Module_Class_Members(SimpleMac, cSimpleModule,0 )	//statistics...		int bufferFullDiscard;		//OMNeT++ 	virtual void initialize();	virtual void handleMessage(cMessage*);	virtual void finish();};#endif

⌨️ 快捷键说明

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