📄 bandwidthmanager.h
字号:
#ifndef _BandwidthManager_h
#define _BandwidthManager_h
#include "Common.h"
class Connection;
class BandwidthManager
{
private:
unsigned long mBandwidth; /* total bandwidth */
unsigned long mBandwidthIn; /* total bandwidth for front direction */
unsigned long mBandwidthOut; /*total bandwidth for back direction */
unsigned long mAvailableBandwidthIn; /* available bandwidth for front direction */
unsigned long mAvailableBandwidthOut; /* available bandwidth for back direction */
set<Connection *> mActiveConnectionSetIn;
set<Connection *> mInactiveConnectionSetIn;
set<Connection *> mActiveConnectionSetOut;
set<Connection *> mInactiveConnectionSetOut;
public:
BandwidthManager();
~BandwidthManager();
void setBandwidth(unsigned long bandwidth);
void setBandwidth(bool flag, unsigned long bandwidth);
unsigned long getBandwidth() const;
unsigned long getBandwidth(bool flag) const;
unsigned long getAvailableBandwidth(bool flag) const;
unsigned long getAverageBandwidthA(bool flag) const;
unsigned long getAverageBandwidthB(bool flag) const;
int getActiveNumber(bool flag) const;
int getInactiveNumber(bool flag) const;
set<Connection *> getActiveConnectionSet(bool flag) const;
set<Connection *> getInactiveConnectionSet(bool flag) const;
void addConnection(bool flag, Connection *pc);
void removeConnection(bool flag, Connection *pc);
void activateConnection(bool flag, Connection *pc);
void inactivateConnection(bool flag, Connection *pc);
void adjustUp(bool flag, Connection *pc, unsigned long value);
void adjustDown(bool flag, Connection *pc, unsigned long value);
void reset();
void reallocate();
Connection *getMinConnection(bool flag);
Connection *getMaxConnection(bool flag);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -