00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TMWSERV_BANDWIDTH_H_
00023 #define _TMWSERV_BANDWIDTH_H_
00024
00025 #include <map>
00026
00027 class NetComputer;
00028
00029 class BandwidthMonitor
00030 {
00031 public:
00032 BandwidthMonitor();
00033 void increaseInterServerOutput(int size);
00034 void increaseInterServerInput(int size);
00035 void increaseClientOutput(NetComputer *nc, int size);
00036 void increaseClientInput(NetComputer *nc, int size);
00037 int totalInterServerOut() const { return mAmountServerOutput; }
00038 int totalInterServerIn() const { return mAmountServerInput; }
00039 int totalClientOut() const { return mAmountClientOutput; }
00040 int totalClientIn() const { return mAmountClientInput; }
00041
00042 private:
00043 int mAmountServerOutput;
00044 int mAmountServerInput;
00045 int mAmountClientOutput;
00046 int mAmountClientInput;
00047
00048 typedef std::map<NetComputer*, std::pair<int, int> > ClientBandwidth;
00049 ClientBandwidth mClientBandwidth;
00050 };
00051
00052 extern BandwidthMonitor *gBandwidth;
00053
00054 #endif