Made to Order Software Corporation Logo

LLChatLib: LLSegment Class Reference

LLSegment Class Reference

A segment is a single, contiguous chunk of memory in a buffer. More...

#include <llbuffer.h>

List of all members.

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.


Detailed Description

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.


Constructor & Destructor Documentation

LLSegment::LLSegment (  ) 

Member Function Documentation

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.

Returns:
A potentially NULL pointer to the raw buffer data
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.

Parameters:
rhs the segment to compare with this segment.
Returns:
Returns true if they are equal.

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