agent.h

来自「模拟P2P各种网络环境的,适合新手们的学习,不错的源码.」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef __AGENT_H__
#define __AGENT_H__
#include "SimEvent.h"

class Node;
class Agent: public SimEventHandler{
public:
	/*
	**attached node in topology
	*/
	Node* mNode;
	/*
	**agent id
	*/
	int mAgentID;
	unsigned long  MaxOutBandWidth;
	unsigned long  MaxInBandwidth;
	/*
	**for agent id
	*/
	static int NEXTAGENTID;

public:
	Agent(void);
	Agent(int i);
	~Agent(void);
	Node* getNode(void){
		return mNode;
	};
	int getID(void){
		return mAgentID;
	}
	void attachTo( Node* node );
       void handler(SimEvent*);
	   
	void setMaxInBandwidth( unsigned long  mount){
		MaxInBandwidth = mount;
       }
	void setMaxOutBandwidth( unsigned long  mount){
		MaxOutBandWidth = mount;
	}
	unsigned long getInBandwidth( void ){
		return MaxInBandwidth;
	}
	unsigned long getOutBandwidth(void){
		return MaxOutBandWidth;
	};
};
#endif

⌨️ 快捷键说明

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