?? asyncmaclayer.h.bak
字號:
/* -*- mode:c++ -*- ********************************************************
* file: AsyncMacLayer.h
*
* author: Yupeng.hu
*
* copyright: (C) 2006 HUNAN Universtiy, ChangSha China
*
***************************************************************************
* part of: Async Simulation
* description: - Async Description
*
***************************************************************************
* changelog: $Revision$
* last modified: $Date: 2006-7-7 10:21 $
* by: $Author: Yupeng.hu $
***************************************************************************/
#ifndef ASYNCMAC_LAYER_H
#define ASYNCMAC_LAYER_H
#include <BasicMacLayer.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <list>
#include <vector>
#include <string>
#include <deque>
#include <map>
#include <mysql.h>
#define e 2.718
#define IS_ACTIVE 0
#define IS_SLEEP 1
class AsyncMacLayer : public BasicMacLayer
{
typedef std::vector<MacPkt*> cMacPktVector;
typedef std::vector<MacPkt*>::iterator vc_iterator;
public:
Module_Class_Members(AsyncMacLayer, BasicMacLayer, 0);
virtual void initialize(int);
virtual void finish();
protected:
/** @brief Handle self messages such as timer... */
virtual void handleSelfMsg(cMessage*);
/** @brief Handle messages from upper layer */
virtual void handleUpperMsg(MacPkt*);
/** @brief Handle messages from lower layer */
virtual void handleLowerMsg(MacPkt*);
/** @brief Pointer to RadioState published on the Blackboard*/
BBItemRef bbRs;
/** @brief start to pop up msg in data queue*/
void startPop();
/**@brief handle messages time_out*/
void timeOutA();
void displayStatus(bool);
int status;
private:
cQueue queue;
cMacPktVector backupVector;
cMacPktVector tempCount;
vc_iterator tempIterator;
int resendCounter;
int tempAddr;
int i;//暫時使用,用作節(jié)點標記 int ackTap;
double cycleTime;
cMessage *sleepEvent;
cMessage *activeEvent;
cMessage *popEvent;
cMessage *iniEvent;
cMessage *timeOut;
cMessage *energe;
long numFramesDropped;
long numFramesCollision;
double sleepTimestamp;
int numBurstMessage;
int groupSize;
double wakeupTime;
double alfa;
double sleepTime;
double roundTime;
double activeTime;
double rxEnergy;
double txEnergy;
double sleepEnergy;
cTopology *topo;
/** @brief distance of this node to the target node */
double distance;
/**
* @brief energy consumption for communications-mW
**/
double energyConsumption;
/**
* @brief the number of packet received
**/
int numPacketRcvd;
/**
* @brief the last time beginning to sleep
**/
double sleepStartTimestamp;
// uncomment the following lines to use the blackboard
/*
virtual bool blackboardItemChanged( BBItemRef );
virtual bool blackboardItemPublished( BBItemRef );
virtual bool blackboardItemWithdrawn( BBItemRef );
*/
};
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -