/* */ #ifndef D_BT_STOP_DOWNLOAD_COMMAND_H #define D_BT_STOP_DOWNLOAD_COMMAND_H #include "TimeBasedCommand.h" #include "SharedHandle.h" 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_; time_t timeout_; Timer checkPoint_; SharedHandle btRuntime_; SharedHandle pieceStorage_; public: BtStopDownloadCommand (cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t timeout); virtual void preProcess(); virtual void process(); void setBtRuntime(const SharedHandle& btRuntime) { btRuntime_ = btRuntime; } void setPieceStorage(const SharedHandle& pieceStorage) { pieceStorage_ = pieceStorage; } }; } // namespace aria2 #endif // D_BT_STOP_DOWNLOAD_COMMAND_H