LibreOffice Module vcl (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Idle Class Reference

An idle is a timer to be scheduled immediately. More...

#include <idle.hxx>

Inheritance diagram for Idle:
[legend]
Collaboration diagram for Idle:
[legend]

Public Member Functions

 Idle (const sal_Char *pDebugName=nullptr)
 
virtual void Start () override
 Activates the timer task. More...
 
- Public Member Functions inherited from Timer
 Timer (const sal_Char *pDebugName=nullptr)
 
 Timer (const Timer &rTimer)
 
virtual ~Timer () override
 
Timeroperator= (const Timer &rTimer)
 
virtual void Invoke () override
 Calls the maInvokeHandler with the parameter this. More...
 
void Invoke (Timer *arg)
 Calls the maInvokeHandler with the parameter. More...
 
void SetInvokeHandler (const Link< Timer *, void > &rLink)
 
void ClearInvokeHandler ()
 
void SetTimeout (sal_uInt64 nTimeoutMs)
 
sal_uInt64 GetTimeout () const
 
- Public Member Functions inherited from Task
 Task (const sal_Char *pDebugName)
 
 Task (const Task &rTask)
 
virtual ~Task () COVERITY_NOEXCEPT_FALSE
 
Taskoperator= (const Task &rTask)
 
void SetPriority (TaskPriority ePriority)
 
TaskPriority GetPriority () const
 
void SetDebugName (const sal_Char *pDebugName)
 
const char * GetDebugName () const
 
void Stop ()
 
bool IsActive () const
 
void SetStatic ()
 This function must be called for static tasks, so the Task destructor ignores the SchedulerMutex, as it may not be available anymore. More...
 
bool IsStatic () const
 

Protected Member Functions

virtual sal_uInt64 UpdateMinPeriod (sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow) const override
 How long (in MS) until the Task is ready to be dispatched? More...
 
 Idle (bool bAuto, const sal_Char *pDebugName)
 
- Protected Member Functions inherited from Timer
virtual void SetDeletionFlags () override
 
 Timer (bool bAuto, const sal_Char *pDebugName)
 
- Protected Member Functions inherited from Task
const ImplSchedulerDataGetSchedulerData () const
 

Private Member Functions

void SetTimeout (sal_uInt64 nTimeoutMs)=delete
 
sal_uInt64 GetTimeout () const =delete
 

Additional Inherited Members

- Static Protected Member Functions inherited from Task
static void StartTimer (sal_uInt64 nMS)
 

Detailed Description

An idle is a timer to be scheduled immediately.

It's - more or less - just a convenience class.

Definition at line 30 of file idle.hxx.

Constructor & Destructor Documentation

Idle::Idle ( bool  bAuto,
const sal_Char pDebugName 
)
protected

Definition at line 23 of file idle.cxx.

References DEFAULT_IDLE, and Task::SetPriority().

Idle::Idle ( const sal_Char pDebugName = nullptr)

Definition at line 29 of file idle.cxx.

Member Function Documentation

sal_uInt64 Idle::GetTimeout ( ) const
privatedelete
void Idle::SetTimeout ( sal_uInt64  nTimeoutMs)
privatedelete
void Idle::Start ( )
overridevirtual
sal_uInt64 Idle::UpdateMinPeriod ( sal_uInt64  nMinPeriod,
sal_uInt64  nTimeNow 
) const
overrideprotectedvirtual

How long (in MS) until the Task is ready to be dispatched?

Simply return Scheduler::ImmediateTimeoutMs if you're ready, like an Idle. If you have to return Scheduler::InfiniteTimeoutMs, you probably need another mechanism to wake up the Scheduler or rely on other Tasks to be scheduled, or simply use a polling Timer.

Parameters
nMinPeriodthe currently expected sleep time
nTimeNowthe current time
Returns
the sleep time of the Task to become ready

Reimplemented from Timer.

Definition at line 55 of file idle.cxx.

References Scheduler::ImmediateTimeoutMs.


The documentation for this class was generated from the following files: