LibreOffice Module sd (master) 1
|
Execute an AsynchronousTask timer based, i.e. More...
#include <TimerBasedTaskExecution.hxx>
Classes | |
class | Deleter |
Used by the shared_ptr instead of the private destructor. More... | |
Public Member Functions | |
void | Release () |
Stop the execution of the task and release the shared pointer to itself so that it will eventually be destroyed. More... | |
Static Public Member Functions | |
static std::shared_ptr< TimerBasedTaskExecution > | Create (const std::shared_ptr< AsynchronousTask > &rpTask, sal_uInt32 nMillisecondsBetweenSteps, sal_uInt32 nMaxTimePerStep) |
Create a new object of this class. More... | |
static void | ReleaseTask (const std::weak_ptr< TimerBasedTaskExecution > &rpTask) |
Convenience method that calls Release() on the given task. More... | |
Private Member Functions | |
TimerBasedTaskExecution (std::shared_ptr< AsynchronousTask > pTask, sal_uInt32 nMillisecondsBetweenSteps, sal_uInt32 nMaxTimePerStep) | |
~TimerBasedTaskExecution () | |
DECL_LINK (TimerCallback, Timer *, void) | |
Private Attributes | |
std::shared_ptr< AsynchronousTask > | mpTask |
Timer | maTimer |
std::shared_ptr< TimerBasedTaskExecution > | mpSelf |
This shared_ptr to this is used to destroy a TimerBasedTaskExecution object when its task has been executed completely. More... | |
sal_uInt32 | mnMaxTimePerStep |
Friends | |
class | Deleter |
Execute an AsynchronousTask timer based, i.e.
every nMillisecondsBetweenSteps milliseconds as much steps are executed as fit into a nMaxTimePerStep millisecond interval.
When a task is executed completely, i.e. HasNextStep() returns <FALSE>, the TimerBasedTaskExecution destroys itself. This, of course, works only if the creating instance does not hold a shared_ptr to that object.
Definition at line 38 of file TimerBasedTaskExecution.hxx.
|
private |
Definition at line 83 of file TimerBasedTaskExecution.cxx.
References LINK, maTimer, Timer::SetInvokeHandler(), Timer::SetTimeout(), and Timer::Start().
Referenced by Create().
|
private |
Definition at line 96 of file TimerBasedTaskExecution.cxx.
References maTimer, and Task::Stop().
|
static |
Create a new object of this class.
rpTask | The AsynchronousTask that is to be executed. |
nMillisecondsBetweenSteps | Wait at least this long between the execution of steps. Note that more than one step may be executed in succession. |
nMaxTimePerStep | The maximal time for executing steps without yielding control. |
Definition at line 40 of file TimerBasedTaskExecution.cxx.
References Deleter, and TimerBasedTaskExecution().
Referenced by sd::sidebar::MasterPageContainer::Implementation::LateInit().
|
private |
void sd::tools::TimerBasedTaskExecution::Release | ( | ) |
Stop the execution of the task and release the shared pointer to itself so that it will eventually be destroyed.
Definition at line 56 of file TimerBasedTaskExecution.cxx.
References maTimer, mpSelf, and Task::Stop().
|
static |
Convenience method that calls Release() on the given task.
It checks the given weak_ptr for being expired and catches bad_weak_ptr exceptions.
Definition at line 63 of file TimerBasedTaskExecution.cxx.
Referenced by sd::sidebar::MasterPageContainer::Implementation::~Implementation().
|
friend |
Definition at line 82 of file TimerBasedTaskExecution.hxx.
Referenced by Create().
|
private |
Definition at line 68 of file TimerBasedTaskExecution.hxx.
Referenced by Release(), TimerBasedTaskExecution(), and ~TimerBasedTaskExecution().
|
private |
Definition at line 73 of file TimerBasedTaskExecution.hxx.
|
private |
This shared_ptr to this is used to destroy a TimerBasedTaskExecution object when its task has been executed completely.
Definition at line 72 of file TimerBasedTaskExecution.hxx.
Referenced by Release().
|
private |
Definition at line 67 of file TimerBasedTaskExecution.hxx.