/* */ #ifndef D_DELAYED_COMMAND_H #define D_DELAYED_COMMAND_H #include "TimeBasedCommand.h" namespace aria2 { class DelayedCommand : public TimeBasedCommand { private: std::unique_ptr command_; bool noWait_; public: virtual void process() CXX11_OVERRIDE { auto e = getDownloadEngine(); e->addCommand(std::move(command_)); if (noWait_) { e->setNoWait(true); } enableExit(); } public: DelayedCommand(cuid_t cuid, DownloadEngine* e, std::chrono::seconds delay, std::unique_ptr command, bool noWait) : TimeBasedCommand(cuid, e, std::move(delay)), command_{std::move(command)}, noWait_{noWait} { } virtual ~DelayedCommand() {} }; } // namespace aria2 #endif // D_DELAYED_COMMAND_H