LLBuffer Class Reference

Abstract base class for buffers. More...

#include <llbuffer.h>

Inheritance diagram for LLBuffer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~LLBuffer ()
 The buffer base class should have no responsibilities other than an interface.
virtual bool createSegment (S32 channel, S32 size, LLSegment &segment)=0
 Generate a segment for this buffer.
virtual bool reclaimSegment (const LLSegment &segment)=0
 Reclaim a segment from this buffer.
virtual bool containsSegment (const LLSegment &segment) const =0
 Test if a segment is inside this buffer.
virtual S32 capacity () const =0
 Return the current number of bytes allocated.

Detailed Description

Abstract base class for buffers.

This class declares the interface necessary for buffer arrays. A buffer is not necessarily a single contiguous memory chunk, so please do not circumvent the segment API.

Definition at line 140 of file llbuffer.h.


Constructor & Destructor Documentation

virtual LLBuffer::~LLBuffer (  )  [inline, virtual]

The buffer base class should have no responsibilities other than an interface.

Definition at line 147 of file llbuffer.h.


Member Function Documentation

virtual S32 LLBuffer::capacity (  )  const [pure virtual]

Return the current number of bytes allocated.

This was implemented as a debugging tool, and it is not necessarily a good idea to use it for anything else.

Implemented in LLHeapBuffer.

virtual bool LLBuffer::containsSegment ( const LLSegment segment  )  const [pure virtual]

Test if a segment is inside this buffer.

Parameters:
segment The contiguous buffer segment to test.
Returns:
Returns true if the segment is in the bufffer.

Implemented in LLHeapBuffer.

virtual bool LLBuffer::createSegment ( S32  channel,
S32  size,
LLSegment segment 
) [pure virtual]

Generate a segment for this buffer.

The segment returned is always contiguous memory. This call can fail if no contiguous memory is available, eg, offset is past the end. The segment returned may be smaller than the requested size. The segment will never be larger than the requested size.

Parameters:
channel The channel for the segment.
offset The offset from zero in the buffer.
size The requested size of the segment.
segment[out] The out-value from the operation
Returns:
Returns true if a segment was found.

Implemented in LLHeapBuffer.

Referenced by LLBufferArray::copyIntoBuffers(), and LLBufferArray::makeSegment().

virtual bool LLBuffer::reclaimSegment ( const LLSegment segment  )  [pure virtual]

Reclaim a segment from this buffer.

This method is called on a buffer object when a caller is done with a contiguous segment of memory inside this buffer. Since segments can be cut arbitrarily outside of the control of the buffer, this segment may not match any segment returned from createSegment().

Parameters:
segment The contiguous buffer segment to reclaim.
Returns:
Returns true if the call was successful.

Implemented in LLHeapBuffer.


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