summaryrefslogtreecommitdiffstats
path: root/src/datasource/networkspeed.h
blob: 482f4cde084d248ea874125429949112ba80a3d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef NETWORKSPEED_H_
#define NETWORKSPEED_H_

#include "idatasource.h"
#include <QElapsedTimer>
#include <QFile>

class NetworkSpeed : public IDataSource {
public:
	NetworkSpeed();
	virtual ~NetworkSpeed();

	virtual qint64 read();
	virtual const QList<qint64>& getBars() const;
	virtual qint64 getMaximum();

private:
	qint64 _lastBytes;
	qint64 _lastMs;
	QElapsedTimer _timer;
	QFile _file;
};

#endif /* NETWORKSPEED_H_ */