A segment is a single, contiguous chunk of memory in a buffer. More...
#include <llbuffer.h>
Public Member Functions | |
U8 * | data () const |
Return a raw pointer to the current data set. | |
S32 | getChannel () const |
Get the channel. | |
bool | isOnChannel (S32 channel) const |
Check if this segment is on the given channel. | |
LLSegment () | |
bool | operator== (const LLSegment &rhs) const |
Check if two segments are the same. | |
void | setChannel (S32 channel) |
Set the channel. | |
S32 | size () const |
Return the size of the segment. |
A segment is a single, contiguous chunk of memory in a buffer.
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.
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.
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. |