/* */ #ifndef _D_TORRENT_CONSOLE_DOWNLOAD_ENGINE_H_ #define _D_TORRENT_CONSOLE_DOWNLOAD_ENGINE_H_ #include "TorrentDownloadEngine.h" class TorrentConsoleDownloadEngine : public TorrentDownloadEngine { private: /* struct timeval cp; long long int sessionDownloadSize; long long int sessionUploadSize; */ struct timeval cp[2]; long long int sessionDownloadLengthArray[2]; long long int sessionUploadLengthArray[2]; int currentCp; int downloadSpeed; int uploadSpeed; int lastElapsed; long long int partialDownloadLengthDiff; long long int partialTotalLength; struct timeval startup; long long int sessionDownloadLength; int avgSpeed; int eta; long long int downloadLength; long long int totalLength; void printStatistics(); int calculateSpeed(long long int sessionLength, int elapsed); protected: void initStatistics(); void calculateStatistics(); void onPartialDownloadingCompletes(); public: TorrentConsoleDownloadEngine(); ~TorrentConsoleDownloadEngine(); }; #endif // _D_TORRENT_CONSOLE_DOWNLOAD_ENGINE_H_