LLWorkerClass Class Reference

#include <llworkerthread.h>

Inheritance diagram for LLWorkerClass:

Inheritance graph
[legend]
Collaboration diagram for LLWorkerClass:

Collaboration graph
[legend]

List of all members.

Public Types

enum  FLAGS {
  WCF_HAVE_WORK = 0x01, WCF_WORKING = 0x02, WCF_WORK_FINISHED = 0x10, WCF_WORK_ABORTED = 0x20,
  WCF_DELETE_REQUESTED = 0x40, WCF_ABORT_REQUESTED = 0x80
}
typedef LLWorkerThread::handle_t handle_t

Public Member Functions

 LLWorkerClass (LLWorkerThread *workerthread, const std::string &name)
virtual ~LLWorkerClass ()
virtual bool doWork (S32 param)=0
virtual void finishWork (S32 param, bool completed)
virtual bool deleteOK ()
void scheduleDelete ()
bool haveWork ()
bool isWorking ()
bool wasAborted ()
void setPriority (U32 priority)
U32 getPriority ()
const std::string & getName () const

Protected Member Functions

void setWorking (bool working)
bool yield ()
void setWorkerThread (LLWorkerThread *workerthread)
void addWork (S32 param, U32 priority=LLWorkerThread::PRIORITY_NORMAL)
void abortWork (bool autocomplete)
bool checkWork (bool aborting=false)

Protected Attributes

LLWorkerThreadmWorkerThread
std::string mWorkerClassName
handle_t mRequestHandle
U32 mRequestPriority

Private Member Functions

void setFlags (U32 flags)
void clearFlags (U32 flags)
U32 getFlags ()
bool getFlags (U32 flags)
virtual void startWork (S32 param)=0
virtual void endWork (S32 param, bool aborted)=0

Private Attributes

LLMutex mMutex
LLAtomicU32 mWorkFlags

Friends

class LLWorkerThread
class LLWorkerThread::WorkRequest


Detailed Description

Definition at line 117 of file llworkerthread.h.


Member Typedef Documentation

Definition at line 122 of file llworkerthread.h.


Member Enumeration Documentation

Enumerator:
WCF_HAVE_WORK 
WCF_WORKING 
WCF_WORK_FINISHED 
WCF_WORK_ABORTED 
WCF_DELETE_REQUESTED 
WCF_ABORT_REQUESTED 

Definition at line 123 of file llworkerthread.h.


Constructor & Destructor Documentation

LLWorkerClass::LLWorkerClass ( LLWorkerThread workerthread,
const std::string &  name 
)

Definition at line 183 of file llworkerthread.cpp.

References llendl, llerrs, and mWorkerThread.

LLWorkerClass::~LLWorkerClass (  )  [virtual]


Member Function Documentation

virtual bool LLWorkerClass::doWork ( S32  param  )  [pure virtual]

Implemented in LLImageWorker, LLTextureCacheWorker, and LLTextureFetchWorker.

Referenced by LLWorkerThread::WorkRequest::processRequest().

Here is the caller graph for this function:

void LLWorkerClass::finishWork ( S32  param,
bool  completed 
) [virtual]

Reimplemented in LLTextureCacheWorker, and LLTextureFetchWorker.

Definition at line 229 of file llworkerthread.cpp.

Referenced by LLWorkerThread::WorkRequest::finishRequest().

Here is the caller graph for this function:

bool LLWorkerClass::deleteOK (  )  [virtual]

Reimplemented in LLTextureFetchWorker.

Definition at line 234 of file llworkerthread.cpp.

Referenced by LLWorkerThread::update().

Here is the caller graph for this function:

void LLWorkerClass::scheduleDelete (  ) 

bool LLWorkerClass::haveWork (  )  [inline]

bool LLWorkerClass::isWorking (  )  [inline]

Definition at line 148 of file llworkerthread.h.

References getFlags(), and WCF_WORKING.

Here is the call graph for this function:

bool LLWorkerClass::wasAborted (  )  [inline]

Definition at line 149 of file llworkerthread.h.

References getFlags(), and WCF_ABORT_REQUESTED.

Referenced by LLTextureFetch::createRequest(), LLImageWorker::doWork(), and LLTextureFetch::getRequestFinished().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLWorkerClass::setPriority ( U32  priority  ) 

U32 LLWorkerClass::getPriority (  )  [inline]

Definition at line 153 of file llworkerthread.h.

References mRequestPriority.

Referenced by LLTextureFetch::getFetchState(), and LLTextureFetchWorker::setImagePriority().

Here is the caller graph for this function:

const std::string& LLWorkerClass::getName (  )  const [inline]

Definition at line 155 of file llworkerthread.h.

References mWorkerClassName.

void LLWorkerClass::setWorking ( bool  working  )  [protected]

Definition at line 242 of file llworkerthread.cpp.

References clearFlags(), llassert_always, LLMutex::lock(), mMutex, mWorkFlags, setFlags(), LLMutex::unlock(), and WCF_WORKING.

Referenced by LLWorkerThread::WorkRequest::processRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLWorkerClass::yield (  )  [protected]

Definition at line 260 of file llworkerthread.cpp.

References LLThread::checkPause(), getFlags(), LLMutex::lock(), mMutex, mWorkerThread, LLMutex::unlock(), WCF_ABORT_REQUESTED, and LLThread::yield().

Here is the call graph for this function:

void LLWorkerClass::setWorkerThread ( LLWorkerThread workerthread  )  [protected]

Definition at line 215 of file llworkerthread.cpp.

References llendl, llerrs, LLMutex::lock(), mMutex, mRequestHandle, mWorkerThread, LLQueuedThread::nullHandle(), and LLMutex::unlock().

Here is the call graph for this function:

void LLWorkerClass::addWork ( S32  param,
U32  priority = LLWorkerThread::PRIORITY_NORMAL 
) [protected]

void LLWorkerClass::abortWork ( bool  autocomplete  )  [protected]

bool LLWorkerClass::checkWork ( bool  aborting = false  )  [protected]

void LLWorkerClass::setFlags ( U32  flags  )  [inline, private]

Definition at line 178 of file llworkerthread.h.

References mWorkFlags.

Referenced by abortWork(), addWork(), LLWorkerThread::WorkRequest::finishRequest(), scheduleDelete(), and setWorking().

Here is the caller graph for this function:

void LLWorkerClass::clearFlags ( U32  flags  )  [inline, private]

Definition at line 179 of file llworkerthread.h.

References mWorkFlags.

Referenced by addWork(), checkWork(), setWorking(), and LLWorkerThread::update().

Here is the caller graph for this function:

U32 LLWorkerClass::getFlags (  )  [inline, private]

Definition at line 180 of file llworkerthread.h.

References mWorkFlags.

Referenced by checkWork(), haveWork(), isWorking(), scheduleDelete(), LLWorkerThread::update(), wasAborted(), and yield().

Here is the caller graph for this function:

bool LLWorkerClass::getFlags ( U32  flags  )  [inline, private]

Definition at line 181 of file llworkerthread.h.

References mWorkFlags.

virtual void LLWorkerClass::startWork ( S32  param  )  [private, pure virtual]

Implemented in LLImageWorker, LLTextureCacheWorker, and LLTextureFetchWorker.

Referenced by addWork().

Here is the caller graph for this function:

virtual void LLWorkerClass::endWork ( S32  param,
bool  aborted 
) [private, pure virtual]

Implemented in LLImageWorker, LLTextureCacheWorker, and LLTextureFetchWorker.

Referenced by checkWork().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class LLWorkerThread [friend]

Definition at line 119 of file llworkerthread.h.

friend class LLWorkerThread::WorkRequest [friend]

Definition at line 120 of file llworkerthread.h.


Member Data Documentation

std::string LLWorkerClass::mWorkerClassName [protected]

Definition at line 190 of file llworkerthread.h.

Referenced by getName().

Definition at line 192 of file llworkerthread.h.

Referenced by getPriority(), and setPriority().

Definition at line 196 of file llworkerthread.h.

Referenced by addWork(), clearFlags(), getFlags(), setFlags(), setWorking(), and ~LLWorkerClass().


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

Generated on Fri May 16 09:40:04 2008 for SecondLife by  doxygen 1.5.5