Windows C++ Library
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
CThreadPool Class Reference

#include <ThreadPool.hpp>

List of all members.

Public Member Functions

 CThreadPool (size_t nThreads)
 ~CThreadPool ()
void Start ()
void Stop ()
void AddJob (ThreadJobPtr &pJob)
void CancelJob (ThreadJobPtr &pJob)
void CancelAllJobs ()
void ClearCompletedJobs ()
void DeleteCompletedJobs ()
size_t PendingJobCount () const
size_t RunningJobCount () const
size_t CompletedJobCount () const

Protected Types

enum  Status { STOPPED, RUNNING }
typedef Core::SharedPtr
< ThreadPoolThread
ThreadPoolThreadPtr
typedef std::vector
< ThreadPoolThreadPtr
CThreads
typedef std::vector< ThreadJobPtrCJobQueue

Protected Member Functions

void ScheduleJob ()
void OnJobCompleted (ThreadJobPtr &pJob)

Protected Attributes

size_t m_nThreads
Status m_eStatus
CThreads m_oPool
CJobQueue m_oPendingQ
CJobQueue m_oRunningQ
CJobQueue m_oCompletedQ
CCriticalSection m_oLock

Friends

class ThreadPoolThread

Member Typedef Documentation

typedef Core::SharedPtr<ThreadPoolThread> CThreadPool::ThreadPoolThreadPtr [protected]
typedef std::vector<ThreadPoolThreadPtr> CThreadPool::CThreads [protected]
typedef std::vector<ThreadJobPtr> CThreadPool::CJobQueue [protected]

Member Enumeration Documentation

enum CThreadPool::Status [protected]
Enumerator:
STOPPED 
RUNNING 

Constructor & Destructor Documentation

CThreadPool::CThreadPool ( size_t  nThreads)

Member Function Documentation

size_t CThreadPool::PendingJobCount ( ) const [inline]
size_t CThreadPool::RunningJobCount ( ) const [inline]
size_t CThreadPool::CompletedJobCount ( ) const [inline]
void CThreadPool::ScheduleJob ( ) [protected]
void CThreadPool::OnJobCompleted ( ThreadJobPtr pJob) [protected]

Friends And Related Function Documentation

friend class ThreadPoolThread [friend]

Member Data Documentation

size_t CThreadPool::m_nThreads [protected]

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