/* */ #ifndef _D_CONSOLE_DOWNLOAD_ENGINE_H_ #define _D_CONSOLE_DOWNLOAD_ENGINE_H_ #include "DownloadEngine.h" #include "TimeA2.h" class ConsoleDownloadEngine : public DownloadEngine { private: Time cp; int64_t psize; int32_t speed; // The time when startup Time startup; // The number of bytes downloaded at startup int64_t startupLength; bool isStartupLengthSet; // The average speed(bytes per second) since startup int32_t avgSpeed; // The estimated remaining time to complete the download. int32_t eta; protected: void sendStatistics(int64_t currentSize, int64_t totalSize); virtual void initStatistics(); virtual void calculateStatistics(); virtual void onEndOfRun(); virtual void afterEachIteration(); public: ConsoleDownloadEngine(); ~ConsoleDownloadEngine(); void fillCommand(); }; #endif // _D_CONSOLE_DOWNLOAD_ENGINE_H_