#include <lliobuffer.h>
Inheritance diagram for LLIOBuffer:
Public Types | |
READ | |
WRITE | |
enum | EHead { READ, WRITE } |
Enumeration passed into the seek function. More... | |
Public Member Functions | |
LLIOBuffer () | |
virtual | ~LLIOBuffer () |
U8 * | data () const |
Return a raw pointer to the current data set. | |
S64 | size () const |
Return the size of the buffer. | |
U8 * | current () const |
Return a raw pointer to the current read position in the data. | |
S64 | bytesLeft () const |
Return the number of unprocessed bytes in buffer. | |
void | clear () |
Move the buffer offsets back to the beginning. | |
EStatus | seek (EHead head, S64 delta) |
Seek to a place in the buffer. | |
Protected Member Functions | |
virtual EStatus | process_impl (const LLChannelDescriptors &channels, buffer_ptr_t &buffer, bool &eos, LLSD &context, LLPumpIO *pump) |
Process the data in buffer. | |
Protected Attributes | |
U8 * | mBuffer |
S64 | mBufferSize |
U8 * | mReadHead |
U8 * | mWriteHead |
Definition at line 51 of file lliobuffer.h.
enum LLIOBuffer::EHead |
Enumeration passed into the seek function.
The READ head is used for where to start processing data for the next link in the chain, while the WRITE head specifies where new data processed from the previous link in the chain will be written.
Definition at line 102 of file lliobuffer.h.
LLIOBuffer::LLIOBuffer | ( | ) |
Definition at line 40 of file lliobuffer.cpp.
LLIOBuffer::~LLIOBuffer | ( | ) | [virtual] |
S64 LLIOBuffer::bytesLeft | ( | ) | const |
Return the number of unprocessed bytes in buffer.
Definition at line 71 of file lliobuffer.cpp.
References mReadHead, and mWriteHead.
void LLIOBuffer::clear | ( | ) |
Move the buffer offsets back to the beginning.
This method effectively clears what has been stored here, without mucking around with memory allocation.
Definition at line 76 of file lliobuffer.cpp.
References mBuffer, mReadHead, and mWriteHead.
U8 * LLIOBuffer::current | ( | ) | const |
Return a raw pointer to the current read position in the data.
The pointer returned can be used for reading or even adjustment if you are a bit crazy up to bytesLeft() bytes into memory.
Definition at line 66 of file lliobuffer.cpp.
References mReadHead.
U8 * LLIOBuffer::data | ( | ) | const |
Return a raw pointer to the current data set.
The pointer returned can be used for reading or even adjustment if you are a bit crazy up to size() bytes into memory.
Definition at line 56 of file lliobuffer.cpp.
References mBuffer.
LLIOPipe::EStatus LLIOBuffer::process_impl | ( | const LLChannelDescriptors & | channels, | |
buffer_ptr_t & | buffer, | |||
bool & | eos, | |||
LLSD & | context, | |||
LLPumpIO * | pump | |||
) | [protected, virtual] |
Process the data in buffer.
Definition at line 109 of file lliobuffer.cpp.
References llendl, llwarns, and LLIOPipe::STATUS_OK.
LLIOPipe::EStatus LLIOBuffer::seek | ( | EHead | head, | |
S64 | delta | |||
) |
Seek to a place in the buffer.
head | The READ or WRITE head. | |
delta | The offset from the current position to seek. |
Definition at line 82 of file lliobuffer.cpp.
References mBuffer, mBufferSize, mReadHead, mWriteHead, READ, LLIOPipe::STATUS_ERROR, LLIOPipe::STATUS_OK, and WRITE.
S64 LLIOBuffer::size | ( | ) | const |
Return the size of the buffer.
Definition at line 61 of file lliobuffer.cpp.
References mBufferSize.
U8* LLIOBuffer::mBuffer [protected] |
Definition at line 134 of file lliobuffer.h.
Referenced by clear(), data(), seek(), and ~LLIOBuffer().
S64 LLIOBuffer::mBufferSize [protected] |
U8* LLIOBuffer::mReadHead [protected] |
Definition at line 136 of file lliobuffer.h.
Referenced by bytesLeft(), clear(), current(), and seek().
U8* LLIOBuffer::mWriteHead [protected] |