InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CIdleTaskThread Class Referenceabstract
Inheritance diagram for CIdleTaskThread:
IIdleTaskThreadIIdleTaskIPMUnknown

Public Member Functions

 CIdleTaskThread (IPMUnknown *boss)
 
virtual uint32 RunTask (uint32 schedulerFlags, IdleTimer *timeCheck)
 
virtual void InstallTask (uint32 millisecsBeforeFirstRun)
 
virtual void UninstallTask ()
 
virtual const char * TaskName ()=0
 
uint32 YieldToEventLoop (uint32 millisecSleep=0)
 
virtual bool16 IsShuttingDown () const
 
void ExecuteTaskInMainThread (IIdleTaskThread::Task &task)
 

Static Public Attributes

static const uint32 kCITT_Shutdown = 0x80000000
 

Additional Inherited Members

- Public Types inherited from IIdleTaskThread
enum  { kDefaultIID = IID_IIDLETASKTHREAD }
 
typedef boost::function< void()> Task
 

Member Function Documentation

void CIdleTaskThread::ExecuteTaskInMainThread (IIdleTaskThread::Tasktask)
virtual

INTERNAL USE ONLY! Should be used only by the architecture team! Invokes the specified task in the main application thread. If the call is happening in another thread, this IdleTaskThread will switch to the main thread, execute the task and come right back. If the context is already the main thread, the task will simply be executed. It will NOT go through the event loop. This is useful when a component is really tied to the main execution thread (like UI) and it needs to be executed only in that context.

Implements IIdleTaskThread.

virtual void CIdleTaskThread::InstallTask (uint32 millisecsBeforeFirstRun)
virtual

If you override InstallTask, you must call this version in your override

Implements IIdleTask.

virtual bool16 CIdleTaskThread::IsShuttingDown () const
inlinevirtual

Allows the overriding implementation to detect when the CIdleTaskThread is being shutown. This is needed because an implementation may be in the middle of a YieldToEventLoop() in one part of code and may not have a convenient method to return state to the RunThread().

Returns
kTrue if the Thread is being shutdown, kFalse otherwise.
virtual uint32 CIdleTaskThread::RunTask (uint32 schedulerFlags,
IdleTimertimeCheck 
)
virtual

Do not override RunTask, override RunThread instead

Implements IIdleTask.

virtual const char* CIdleTaskThread::TaskName ()
pure virtual

A friendly reminder that all IIdleTasks need a name

Implements IIdleTask.

virtual void CIdleTaskThread::UninstallTask ()
virtual

If you override UninstallTask, you must call this version in your override

Implements IIdleTask.

uint32 CIdleTaskThread::YieldToEventLoop (uint32 millisecSleep = 0)
virtual

Call YieldToEventLoop periodically in your RunThread method

Implements IIdleTaskThread.