/* */ #ifndef D_BT_STOP_DOWNLOAD_COMMAND_H #define D_BT_STOP_DOWNLOAD_COMMAND_H #include "TimeBasedCommand.h" #include namespace aria2 { class RequestGroup; class PieceStorage; class BtRuntime; // Stop downloading torrent if in consecutive timeout_ seconds, // download speed is zero and the number of seeder is 0. class BtStopDownloadCommand : public TimeBasedCommand { private: RequestGroup* requestGroup_; std::chrono::seconds timeout_; Timer checkPoint_; std::shared_ptr btRuntime_; std::shared_ptr pieceStorage_; public: BtStopDownloadCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, std::chrono::seconds timeout); virtual void preProcess() CXX11_OVERRIDE; virtual void process() CXX11_OVERRIDE; void setBtRuntime(const std::shared_ptr& btRuntime) { btRuntime_ = btRuntime; } void setPieceStorage(const std::shared_ptr& pieceStorage) { pieceStorage_ = pieceStorage; } }; } // namespace aria2 #endif // D_BT_STOP_DOWNLOAD_COMMAND_H