CLAM-Development  1.1
Public Member Functions | Protected Member Functions | Protected Attributes
CLAM::Thread Class Reference

#include <Thread.hxx>

List of all members.

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

Detailed Description

Definition at line 39 of file Thread.hxx.


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

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().

bool CLAM::Thread::operator== ( const Thread other) const
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().

void CLAM::Thread::SetThreadCode ( const CBL::Functor0 &  thread_code)
void CLAM::Thread::SetupPriorityPolicy ( ) [protected, virtual]

Definition at line 57 of file Thread.cxx.

References mRealtime.

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::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().

Definition at line 176 of file Thread.cxx.

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

Definition at line 109 of file Thread.cxx.

References CLAM_ASSERT.


Member Data Documentation

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

Definition at line 85 of file Thread.hxx.

Referenced by SetCleanupCode().

bool CLAM::Thread::mHasCleanup [protected]

Definition at line 80 of file Thread.hxx.

Referenced by SetCleanupCode().

bool CLAM::Thread::mHasCode [protected]

Definition at line 79 of file Thread.hxx.

Referenced by SetThreadCode(), and Start().

bool CLAM::Thread::mIsCancelled [protected]

Definition at line 82 of file Thread.hxx.

Referenced by IsCancelled(), and Stop().

bool CLAM::Thread::mRealtime [protected]

Definition at line 78 of file Thread.hxx.

Referenced by SetupPriorityPolicy().

bool CLAM::Thread::mRunning [protected]

Definition at line 83 of file Thread.hxx.

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

Definition at line 86 of file Thread.hxx.

Referenced by WakeUp().

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

Definition at line 84 of file Thread.hxx.

Referenced by SetThreadCode().

pthread_t CLAM::Thread::mThreadID [protected]

Definition at line 81 of file Thread.hxx.

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


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