/** Execute an AsynchronousTask timer based, i.e. every nMillisecondsBetweenStepsmillisecondsasmuchstepsareexecutedasfit intoanMaxTimePerStepmillisecondinterval.
Whenataskisexecutedcompletely,i.e.HasNextStep()returns<FALSE/>, theTimerBasedTaskExecutiondestroysitself.This,ofcourse,works onlyifthecreatinginstancedoesnotholdashared_ptrtothatobject.
*/ class TimerBasedTaskExecution
{ public: /** Create a new object of this class. @paramrpTask TheAsynchronousTaskthatistobeexecuted. @paramnMillisecondsBetweenSteps Waitatleastthislongbetweentheexecutionofsteps.Note thatmorethanonestepmaybeexecutedinsuccession. @paramnMaxTimePerStep Themaximaltimeforexecutingstepswithoutyieldingcontrol.
*/ static std::shared_ptr<TimerBasedTaskExecution> Create ( const std::shared_ptr<AsynchronousTask>& rpTask,
sal_uInt32 nMillisecondsBetweenSteps,
sal_uInt32 nMaxTimePerStep);
/** Stop the execution of the task and release the shared pointer to itselfsothatitwilleventuallybedestroyed.
*/ void Release();
/** Convenience method that calls Release() on the given task. It checksthegivenweak_ptrforbeingexpiredandcatchesbad_weak_ptr exceptions.
*/ staticvoid ReleaseTask (const std::weak_ptr<TimerBasedTaskExecution>& rpTask);
private:
std::shared_ptr<AsynchronousTask> mpTask;
Timer maTimer; /** This shared_ptr to this is used to destroy a TimerBasedTaskExecution objectwhenitstaskhasbeenexecutedcompletely.
*/
std::shared_ptr<TimerBasedTaskExecution> mpSelf;
sal_uInt32 mnMaxTimePerStep;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.