CLAM::Thread Class Reference

#include <Thread.hxx>

Inheritance diagram for CLAM::Thread:

CLAM::PooledThread

List of all members.


Detailed Description

Definition at line 39 of file Thread.hxx.


Public Member Functions

 Thread (bool realtime=false)
virtual ~Thread ()
virtual void Start ()
virtual void Stop ()
void Sleep ()
void Sleep (unsigned int milliseconds)
void WakeUp ()
void Yield ()
void SetThreadCode (const CBL::Functor0 &thread_code)
void SetCleanupCode (const CBL::Functor0 &cleanup_code)
bool operator== (const Thread &other) const
bool IsCancelled () const
bool IsRunning () const

Protected Member Functions

virtual void SetupPriorityPolicy ()

Protected Attributes

bool mRealtime
bool mHasCode
bool mHasCleanup
pthread_t mThreadID
bool mIsCancelled
bool mRunning
CBL::Functor0 mThreadCode
CBL::Functor0 mCleanUpCode
Condition mSleepCondition

Constructor & Destructor Documentation

CLAM::Thread::Thread ( bool  realtime = false  ) 

Definition at line 42 of file Thread.cxx.

CLAM::Thread::~Thread (  )  [virtual]

Definition at line 51 of file Thread.cxx.

References mRunning, and Stop().


Member Function Documentation

void CLAM::Thread::Start ( void   )  [virtual]

Reimplemented in CLAM::PooledThread.

Definition at line 93 of file Thread.cxx.

References CLAM_ASSERT, mHasCode, mRunning, mThreadID, and NULL.

Referenced by CLAM::BufferedSDIFFileReader::LoadFramesIntoBufferOnThread().

void CLAM::Thread::Stop ( void   )  [virtual]

Definition at line 101 of file Thread.cxx.

References mIsCancelled, and mRunning.

Referenced by CLAM::ThreadPool::EmptyPool(), and ~Thread().

void CLAM::Thread::Sleep (  ) 

Definition at line 156 of file Thread.cxx.

void CLAM::Thread::Sleep ( unsigned int  milliseconds  ) 

Definition at line 151 of file Thread.cxx.

void CLAM::Thread::WakeUp (  ) 

Definition at line 176 of file Thread.cxx.

References mSleepCondition, and CLAM::Condition::NotifyOne().

void CLAM::Thread::Yield (  ) 

Definition at line 109 of file Thread.cxx.

References CLAM_ASSERT.

void CLAM::Thread::SetThreadCode ( const CBL::Functor0 &  thread_code  ) 

void CLAM::Thread::SetCleanupCode ( const CBL::Functor0 &  cleanup_code  ) 

Definition at line 123 of file Thread.cxx.

References mCleanUpCode, and mHasCleanup.

Referenced by CLAM::ProcessingKernel::AttachToThread().

bool CLAM::Thread::operator== ( const Thread other  )  const

bool CLAM::Thread::IsCancelled (  )  const [inline]

Definition at line 65 of file Thread.hxx.

References mIsCancelled.

bool CLAM::Thread::IsRunning (  )  const [inline]

Definition at line 70 of file Thread.hxx.

References mRunning.

Referenced by CLAM::ThreadPool::EmptyPool(), and CLAM::ThreadPool::GetThreadFromPool().

void CLAM::Thread::SetupPriorityPolicy (  )  [protected, virtual]

Definition at line 57 of file Thread.cxx.

References mRealtime.


Member Data Documentation

Definition at line 78 of file Thread.hxx.

Referenced by SetupPriorityPolicy().

Definition at line 79 of file Thread.hxx.

Referenced by SetThreadCode(), and Start().

Definition at line 80 of file Thread.hxx.

Referenced by SetCleanupCode().

pthread_t CLAM::Thread::mThreadID [protected]

Definition at line 81 of file Thread.hxx.

Referenced by Start(), and CLAM::PooledThread::Start().

Definition at line 82 of file Thread.hxx.

Referenced by IsCancelled(), and Stop().

Definition at line 83 of file Thread.hxx.

Referenced by IsRunning(), Start(), CLAM::PooledThread::Start(), Stop(), and ~Thread().

CBL::Functor0 CLAM::Thread::mThreadCode [protected]

Definition at line 84 of file Thread.hxx.

Referenced by SetThreadCode().

CBL::Functor0 CLAM::Thread::mCleanUpCode [protected]

Definition at line 85 of file Thread.hxx.

Referenced by SetCleanupCode().

Definition at line 86 of file Thread.hxx.

Referenced by WakeUp().


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

Generated on Tue Aug 12 22:33:50 2008 for CLAM by  doxygen 1.5.5