LLTextureCacheWorker Class Reference

Inheritance diagram for LLTextureCacheWorker:

Inheritance graph
[legend]
Collaboration diagram for LLTextureCacheWorker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLTextureCacheWorker (LLTextureCache *cache, U32 priority, const LLUUID &id, U8 *data, S32 datasize, S32 offset, S32 imagesize, LLTextureCache::Responder *responder)
 ~LLTextureCacheWorker ()
bool doRead ()
bool doWrite ()
virtual bool doWork (S32 param)
handle_t read ()
handle_t write ()
bool complete ()
void ioComplete (S32 bytes)

Private Types

 INIT = 0
 LOCAL = 1
 CACHE = 2
 HEADER = 3
 BODY = 4
enum  e_state {
  INIT = 0, LOCAL = 1, CACHE = 2, HEADER = 3,
  BODY = 4
}

Private Member Functions

virtual void startWork (S32 param)
virtual void finishWork (S32 param, bool completed)
virtual void endWork (S32 param, bool aborted)

Private Attributes

LLTextureCachemCache
U32 mPriority
LLUUID mID
e_state mState
U8mReadData
U8mWriteData
S32 mDataSize
S32 mOffset
S32 mImageSize
S32 mImageFormat
BOOL mImageLocal
LLPointer< LLTextureCache::RespondermResponder
LLLFSThread::handle_t mFileHandle
S32 mBytesToRead
LLAtomicS32 mBytesRead

Friends

class LLTextureCache

Classes

class  ReadResponder
class  WriteResponder

Detailed Description

Definition at line 48 of file lltexturecache.cpp.


Member Enumeration Documentation

enum LLTextureCacheWorker::e_state [private]

Enumerator:
INIT 
LOCAL 
CACHE 
HEADER 
BODY 

Definition at line 53 of file lltexturecache.cpp.


Constructor & Destructor Documentation

LLTextureCacheWorker::LLTextureCacheWorker ( LLTextureCache cache,
U32  priority,
const LLUUID id,
U8 data,
S32  datasize,
S32  offset,
S32  imagesize,
LLTextureCache::Responder responder 
) [inline]

Definition at line 95 of file lltexturecache.cpp.

References mPriority, and LLQueuedThread::PRIORITY_LOWBITS.

LLTextureCacheWorker::~LLTextureCacheWorker (  )  [inline]

Definition at line 118 of file lltexturecache.cpp.

References LLWorkerClass::haveWork(), llassert_always, and mReadData.


Member Function Documentation

bool LLTextureCacheWorker::complete (  )  [inline]

Definition at line 130 of file lltexturecache.cpp.

References LLWorkerClass::checkWork().

bool LLTextureCacheWorker::doRead (  ) 

Definition at line 166 of file lltexturecache.cpp.

References BODY, CACHE, LLTextureCache::getFileAPRPool(), LLTextureCache::getHeaderCacheEntry(), LLTextureCache::getLocalFileName(), LLTextureCache::getTextureFileName(), HEADER, IMG_CODEC_TGA, INIT, ll_apr_file_read_ex(), ll_apr_file_size(), llassert_always, llendl, llmax(), llmin(), llwarns, LOCAL, mBytesRead, mBytesToRead, mCache, mDataSize, mFileHandle, LLTextureCache::mHeaderDataFileName, mID, mImageFormat, mImageLocal, mImageSize, mOffset, mPriority, mReadData, LLWorkerClass::mRequestHandle, mState, NULL, LLQueuedThread::nullHandle(), LLQueuedThread::PRIORITY_LOW, LLLFSThread::read(), S32, LLWorkerClass::setPriority(), size, LLLFSThread::sLocal, TEXTURE_CACHE_ENTRY_SIZE, and TRUE.

Referenced by doWork().

bool LLTextureCacheWorker::doWork ( S32  param  )  [virtual]

Implements LLWorkerClass.

Definition at line 651 of file lltexturecache.cpp.

References doRead(), doWrite(), and llassert_always.

bool LLTextureCacheWorker::doWrite (  ) 

Definition at line 471 of file lltexturecache.cpp.

References LLTextureCache::appendToTextureEntryList(), BODY, CACHE, LLTextureCache::getFileAPRPool(), LLTextureCache::getHeaderCacheEntry(), LLTextureCache::getTextureFileName(), HEADER, INIT, ll_apr_file_write_ex(), llassert_always, llendl, llmax(), llwarns, mBytesRead, mBytesToRead, mCache, mDataSize, mFileHandle, LLTextureCache::mHeaderDataFileName, mID, mImageSize, mOffset, mPriority, LLWorkerClass::mRequestHandle, mState, mWriteData, LLQueuedThread::nullHandle(), LLQueuedThread::PRIORITY_LOW, S32, LLWorkerClass::setPriority(), size, LLLFSThread::sLocal, TEXTURE_CACHE_ENTRY_SIZE, and LLLFSThread::write().

Referenced by doWork().

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

Implements LLWorkerClass.

Definition at line 702 of file lltexturecache.cpp.

References mCache, mDataSize, mID, and LLTextureCache::removeFromCache().

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

Reimplemented from LLWorkerClass.

Definition at line 670 of file lltexturecache.cpp.

References LLTextureCache::addCompleted(), mCache, mDataSize, mImageFormat, mImageLocal, mImageSize, mReadData, mResponder, mWriteData, LLPointer< Type >::notNull(), and NULL.

void LLTextureCacheWorker::ioComplete ( S32  bytes  )  [inline]

Definition at line 131 of file lltexturecache.cpp.

References mBytesRead, mPriority, LLQueuedThread::PRIORITY_HIGH, and LLWorkerClass::setPriority().

Referenced by LLTextureCacheWorker::WriteResponder::completed(), and LLTextureCacheWorker::ReadResponder::completed().

handle_t LLTextureCacheWorker::read (  )  [inline]

Definition at line 128 of file lltexturecache.cpp.

References LLWorkerClass::addWork(), mPriority, LLWorkerClass::mRequestHandle, and LLQueuedThread::PRIORITY_HIGH.

Referenced by LLTextureCache::readFromCache().

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

Implements LLWorkerClass.

Definition at line 162 of file lltexturecache.cpp.

handle_t LLTextureCacheWorker::write (  )  [inline]

Definition at line 129 of file lltexturecache.cpp.

References LLWorkerClass::addWork(), mPriority, LLWorkerClass::mRequestHandle, and LLQueuedThread::PRIORITY_HIGH.

Referenced by LLTextureCache::writeToCache().


Friends And Related Function Documentation

friend class LLTextureCache [friend]

Definition at line 50 of file lltexturecache.cpp.


Member Data Documentation

LLAtomicS32 LLTextureCacheWorker::mBytesRead [private]

Definition at line 158 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), and ioComplete().

S32 LLTextureCacheWorker::mBytesToRead [private]

Definition at line 157 of file lltexturecache.cpp.

Referenced by doRead(), and doWrite().

LLTextureCache* LLTextureCacheWorker::mCache [private]

Definition at line 143 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), endWork(), and finishWork().

S32 LLTextureCacheWorker::mDataSize [private]

Definition at line 150 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), endWork(), and finishWork().

LLLFSThread::handle_t LLTextureCacheWorker::mFileHandle [private]

Definition at line 156 of file lltexturecache.cpp.

Referenced by doRead(), and doWrite().

LLUUID LLTextureCacheWorker::mID [private]

Definition at line 145 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), and endWork().

S32 LLTextureCacheWorker::mImageFormat [private]

Definition at line 153 of file lltexturecache.cpp.

Referenced by doRead(), and finishWork().

BOOL LLTextureCacheWorker::mImageLocal [private]

Definition at line 154 of file lltexturecache.cpp.

Referenced by doRead(), and finishWork().

S32 LLTextureCacheWorker::mImageSize [private]

Definition at line 152 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), and finishWork().

S32 LLTextureCacheWorker::mOffset [private]

Definition at line 151 of file lltexturecache.cpp.

Referenced by doRead(), and doWrite().

U32 LLTextureCacheWorker::mPriority [private]

Definition at line 144 of file lltexturecache.cpp.

Referenced by doRead(), doWrite(), ioComplete(), LLTextureCacheWorker(), read(), and write().

U8* LLTextureCacheWorker::mReadData [private]

Definition at line 148 of file lltexturecache.cpp.

Referenced by doRead(), finishWork(), and ~LLTextureCacheWorker().

LLPointer<LLTextureCache::Responder> LLTextureCacheWorker::mResponder [private]

Definition at line 155 of file lltexturecache.cpp.

Referenced by finishWork().

e_state LLTextureCacheWorker::mState [private]

Definition at line 146 of file lltexturecache.cpp.

Referenced by doRead(), and doWrite().

U8* LLTextureCacheWorker::mWriteData [private]

Definition at line 149 of file lltexturecache.cpp.

Referenced by doWrite(), and finishWork().


The documentation for this class was generated from the following file:
Generated on Thu Jul 1 06:11:51 2010 for Second Life Viewer by  doxygen 1.4.7