This class is an io class that represents an automtically resizing io buffer. More...
#include <lliobuffer.h>
Public Types | |
enum | EHead |
Enumeration passed into the seek function. More... | |
Public Member Functions | |
S64 | bytesLeft () const |
Return the number of unprocessed bytes in buffer. | |
void | clear () |
Move the buffer offsets back to the beginning. | |
U8 * | current () const |
Return a raw pointer to the current read position in the data. | |
U8 * | data () const |
Return a raw pointer to the current data set. | |
EStatus | seek (EHead head, S64 delta) |
Seek to a place in the buffer. | |
S64 | size () const |
Return the size of 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. |
This class is an io class that represents an automtically resizing io buffer.
This class is currently impelemented quick and dirty, but should be correct. This class should be extended to have a more flexible (and capped) memory allocation and usage scheme. Eventually, I would like to have the ability to share this buffer between different objects.
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.
void LLIOBuffer::clear | ( | void | ) |
Move the buffer offsets back to the beginning.
This method effectively clears what has been stored here, without mucking around with memory allocation.
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.
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.
LLIOPipe::EStatus LLIOBuffer::seek | ( | LLIOBuffer::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. |