#include <llbuffer.h>
Public Member Functions | |
LLSegment () | |
LLSegment (S32 channel, U8 *data, S32 data_len) | |
~LLSegment () | |
bool | isOnChannel (S32 channel) const |
Check if this segment is on the given channel. | |
S32 | getChannel () const |
Get the channel. | |
void | setChannel (S32 channel) |
Set the channel. | |
U8 * | data () const |
Return a raw pointer to the current data set. | |
S32 | size () const |
Return the size of the segment. | |
bool | operator== (const LLSegment &rhs) const |
Check if two segments are the same. | |
Protected Attributes | |
S32 | mChannel |
U8 * | mData |
S32 | mSize |
Each segment represents a contiguous addressable piece of memory which is located inside a buffer. The segment is not responsible for allocation or deallcoation of the data. Each segment is a light weight object, and simple enough to copy around, use, and generate as necessary. This is the preferred interface for working with memory blocks, since it is the only way to safely, inexpensively, and directly access linear blocks of memory.
Definition at line 79 of file llbuffer.h.
LLSegment::LLSegment | ( | ) |
LLSegment::~LLSegment | ( | ) |
U8 * LLSegment::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 81 of file llbuffer.cpp.
References mData.
Referenced by LLHeapBuffer::containsSegment(), LLBufferArray::copyIntoBuffers(), LLIOSocketWriter::process_impl(), and LLBufferStreamBuf::underflow().
S32 LLSegment::getChannel | ( | ) | const |
bool LLSegment::isOnChannel | ( | S32 | channel | ) | const |
Check if this segment is on the given channel.
Definition at line 65 of file llbuffer.cpp.
References mChannel.
Referenced by LLChangeChannel::operator()(), and LLBufferStreamBuf::underflow().
bool LLSegment::operator== | ( | const LLSegment & | rhs | ) | const |
Check if two segments are the same.
Two segments are considered equal if they are on the same channel and cover the exact same address range.
rhs | the segment to compare with this segment. |
Definition at line 91 of file llbuffer.cpp.
Set the channel.
Definition at line 75 of file llbuffer.cpp.
References mChannel.
Referenced by LLChangeChannel::operator()().
S32 LLSegment::size | ( | ) | const |
Return the size of the segment.
Definition at line 86 of file llbuffer.cpp.
References mSize.
Referenced by LLHeapBuffer::containsSegment(), LLBufferArray::copyIntoBuffers(), LLIOSocketWriter::process_impl(), LLHeapBuffer::reclaimSegment(), and LLBufferStreamBuf::underflow().
S32 LLSegment::mChannel [protected] |
Definition at line 127 of file llbuffer.h.
Referenced by getChannel(), isOnChannel(), operator==(), and setChannel().
U8* LLSegment::mData [protected] |
S32 LLSegment::mSize [protected] |