LibreOffice Module vcl (master)  1
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Friends | List of all members
Task Class Referenceabstract

#include <task.hxx>

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

Public Member Functions

 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
 
virtual void Invoke ()=0
 
virtual void Start ()
 
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

const ImplSchedulerDataGetSchedulerData () const
 
virtual void SetDeletionFlags ()
 
virtual sal_uInt64 UpdateMinPeriod (sal_uInt64 nTimeNow) const =0
 How long (in MS) until the Task is ready to be dispatched? More...
 

Static Protected Member Functions

static void StartTimer (sal_uInt64 nMS)
 

Private Attributes

ImplSchedulerDatampSchedulerData
 Pointer to the element in scheduler list. More...
 
const sal_CharmpDebugName
 Useful for debugging. More...
 
TaskPriority mePriority
 Task priority. More...
 
bool mbActive
 Currently in the scheduler. More...
 
bool mbStatic
 Is a static object. More...
 

Friends

class Scheduler
 
struct ImplSchedulerData
 

Detailed Description

Definition at line 41 of file task.hxx.

Constructor & Destructor Documentation

Task::Task ( const sal_Char pDebugName)

Definition at line 627 of file scheduler.cxx.

References DEFAULT, and mbActive.

Task::Task ( const Task rTask)

Definition at line 636 of file scheduler.cxx.

References IsActive(), mbActive, and Start().

Task::~Task ( )
virtual

Member Function Documentation

const char* Task::GetDebugName ( ) const
inline
TaskPriority Task::GetPriority ( ) const
inline

Definition at line 79 of file task.hxx.

References ImplSchedulerData::mePriority.

Referenced by AppendSchedulerData(), and Idle::Start().

const ImplSchedulerData* Task::GetSchedulerData ( ) const
inlineprotected

Definition at line 55 of file task.hxx.

Referenced by Timer::UpdateMinPeriod().

virtual void Task::Invoke ( )
pure virtual

Implemented in Timer, and DebugEventInjector.

Referenced by Scheduler::ProcessTaskScheduling().

bool Task::IsActive ( ) const
inline
bool Task::IsStatic ( ) const
inline

Definition at line 99 of file task.hxx.

Referenced by ~Task().

Task & Task::operator= ( const Task rTask)

Definition at line 610 of file scheduler.cxx.

References IsActive(), mbActive, mePriority, Start(), and Stop().

Referenced by Timer::operator=().

void Task::SetDebugName ( const sal_Char pDebugName)
inline
void Task::SetDeletionFlags ( )
protectedvirtual

Reimplemented in Timer.

Definition at line 546 of file scheduler.cxx.

References mbActive.

Referenced by Scheduler::ProcessTaskScheduling(), and Timer::SetDeletionFlags().

void Task::SetPriority ( TaskPriority  ePriority)
void Task::SetStatic ( )
inline

This function must be called for static tasks, so the Task destructor ignores the SchedulerMutex, as it may not be available anymore.

The cleanup is still correct, as it has already happened in DeInitScheduler call well before the static destructor calls.

Definition at line 98 of file task.hxx.

Referenced by Scheduler::ImplDeInitScheduler().

void Task::Start ( )
virtual
void Task::StartTimer ( sal_uInt64  nMS)
staticprotected
void Task::Stop ( )
virtual sal_uInt64 Task::UpdateMinPeriod ( sal_uInt64  nTimeNow) const
protectedpure virtual

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
nTimeNowthe current time
Returns
the sleep time of the Task to become ready

Implemented in Idle, and Timer.

Referenced by Scheduler::ProcessTaskScheduling().

Friends And Related Function Documentation

friend struct ImplSchedulerData
friend

Definition at line 44 of file task.hxx.

Referenced by Start().

friend class Scheduler
friend

Definition at line 43 of file task.hxx.

Member Data Documentation

bool Task::mbActive
private

Currently in the scheduler.

Definition at line 49 of file task.hxx.

Referenced by Scheduler::ImplDeInitScheduler(), operator=(), SetDeletionFlags(), SetPriority(), Start(), and Stop().

bool Task::mbStatic
private

Is a static object.

Definition at line 50 of file task.hxx.

TaskPriority Task::mePriority
private

Task priority.

Definition at line 48 of file task.hxx.

Referenced by operator=(), SetPriority(), and Start().

const sal_Char* Task::mpDebugName
private

Useful for debugging.

Definition at line 47 of file task.hxx.

ImplSchedulerData* Task::mpSchedulerData
private

Pointer to the element in scheduler list.

Definition at line 46 of file task.hxx.

Referenced by Scheduler::ImplDeInitScheduler(), Scheduler::ProcessTaskScheduling(), SetPriority(), Start(), Stop(), and ~Task().


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