/* */ #include "SleepCommand.h" #include "Util.h" SleepCommand::SleepCommand(int32_t cuid, DownloadEngine* e, Command* nextCommand, int32_t wait): Command(cuid), engine(e), nextCommand(nextCommand), wait(wait) {} SleepCommand::~SleepCommand() { if(nextCommand != NULL) { delete(nextCommand); } } bool SleepCommand::execute() { if(checkPoint.elapsed(wait)) { engine->commands.push_back(nextCommand); nextCommand = NULL; return true; } else { engine->commands.push_back(this); return false; } }