/* */ #include "TimeBasedCommand.h" #include "DownloadEngine.h" TimeBasedCommand::TimeBasedCommand(int32_t cuid, DownloadEngine* e, int32_t interval): Command(cuid), _e(e),_exit(false), _interval(interval) {} TimeBasedCommand::~TimeBasedCommand() {} bool TimeBasedCommand::execute() { preProcess(); if(_exit) { return true; } if(_checkPoint.elapsed(_interval)) { _checkPoint.reset(); process(); if(_exit) { return true; } } postProcess(); if(_exit) { return true; } _e->commands.push_back(this); return false; }