Made to Order Software Corporation Logo

LLChatLib: LLIOBuffer Class Reference

LLIOBuffer Class Reference

This class is an io class that represents an automtically resizing io buffer. More...

#include <lliobuffer.h>

Inheritance diagram for LLIOBuffer:
Collaboration diagram for LLIOBuffer:

List of all members.

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.


Detailed Description

This class is an io class that represents an automtically resizing io buffer.

See also:
LLIOPipe

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.


Member Enumeration Documentation

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.


Member Function Documentation

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.

Returns:
A potentially NULL pointer to the buffer data starting at the read point
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.

Returns:
A potentially NULL pointer to the raw buffer data
LLIOPipe::EStatus LLIOBuffer::seek ( LLIOBuffer::EHead  head,
S64  delta 
)

Seek to a place in the buffer.

Parameters:
head The READ or WRITE head.
delta The offset from the current position to seek.
Returns:
The status of the operation. status >= if head moved.

The documentation for this class was generated from the following files:
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/llmessage/lliobuffer.h
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/llmessage/lliobuffer.cpp
Generated on Thu Sep 23 17:18:41 2010 for LLChatLib by  doxygen 1.6.3