SourceMod::IThreadWorker Class Reference

This is a "worker pool." A single thread places tasks in a queue. Each IThread is then a task, rather than its own separate thread. More...

#include <public/IThreader.h>

Inherits SourceMod::IThreadCreator.

Inheritance diagram for SourceMod::IThreadWorker:

[legend]
Collaboration diagram for SourceMod::IThreadWorker:
[legend]
List of all members.

Public Member Functions

virtual ~IThreadWorker ()
virtual unsigned int RunFrame ()=0
 Runs one "frame" of the worker.
virtual bool Pause ()=0
 Pauses the worker.
virtual bool Unpause ()=0
 Unpauses the worker.
virtual bool Start ()=0
 Starts the worker thread.
virtual bool Stop (bool flush)=0
 Stops the worker thread.
virtual WorkerState GetStatus (unsigned int *numThreads)=0
 Returns the status of the worker.

Detailed Description

This is a "worker pool." A single thread places tasks in a queue. Each IThread is then a task, rather than its own separate thread.

Definition at line 313 of file IThreader.h.


Constructor & Destructor Documentation

virtual SourceMod::IThreadWorker::~IThreadWorker (  )  [inline, virtual]

Virtual Destructor

Definition at line 317 of file IThreader.h.


Member Function Documentation

virtual unsigned int SourceMod::IThreadWorker::RunFrame (  )  [pure virtual]

Runs one "frame" of the worker.

Returns:
Number of tasks processed.

virtual bool SourceMod::IThreadWorker::Pause (  )  [pure virtual]

Pauses the worker.

Returns:
True on success, false otherwise.

virtual bool SourceMod::IThreadWorker::Unpause (  )  [pure virtual]

Unpauses the worker.

Returns:
True on success, false otherwise.

virtual bool SourceMod::IThreadWorker::Start (  )  [pure virtual]

Starts the worker thread.

Returns:
True on success, false otherwise.

virtual bool SourceMod::IThreadWorker::Stop ( bool  flush  )  [pure virtual]

Stops the worker thread.

Parameters:
flush If true, all remaining tasks will be cancelled. Otherwise, the threader will wait until the queue is empty.
Returns:
True on success, false otherwise.

virtual WorkerState SourceMod::IThreadWorker::GetStatus ( unsigned int *  numThreads  )  [pure virtual]

Returns the status of the worker.

Parameters:
numThreads Pointer to store number of threads in the queue.
Returns:
State of the worker.


The documentation for this class was generated from the following file:
Generated on Thu Aug 28 22:10:29 2008 for SourceMod SDK by  doxygen 1.5.1