Frontend::Buffer Class Reference

A buffer of bytes. More...

#include <Buffer.h>

Inheritance diagram for Frontend::Buffer:

Frontend::Object List of all members.

Public Member Functions

 Buffer (unsigned int size)
 Creates a new buffer.
 ~Buffer ()
 Destructs the buffer, releasing the allocated memory.
unsigned int Size ()
 Returns the size of the buffer, in bytes.
void Resize (unsigned int newSize)
 Resizes the buffer.
void * Pointer ()
 Allows the buffer to be used as pointer.
 operator void * ()
 Allows the buffer to be used as pointer.
void AddRef ()
 Adds a reference to the object.
void Release ()
 Releases a reference on the object.
unsigned int GetRefCount ()
 Returns the number of references on the object.

Private Attributes

UInt8 * data
unsigned int size

Detailed Description

A buffer of bytes.

General purpose buffer wrappper.


Constructor & Destructor Documentation

Frontend::Buffer::Buffer unsigned int  size  )  [inline]
 

Creates a new buffer.

Parameters:
size Size of the buffer, in bytes.

Frontend::Buffer::~Buffer  )  [inline]
 

Destructs the buffer, releasing the allocated memory.


Member Function Documentation

void Frontend::Object::AddRef  )  [inherited]
 

Adds a reference to the object.

Aqcuires an additional ownership on the object. The object will not be deleted until all owners have called Release() on it.

See also:
Release()

unsigned int Frontend::Object::GetRefCount  )  [inline, inherited]
 

Returns the number of references on the object.

Returns:
The number of references on the object.

Frontend::Buffer::operator void *  )  [inline]
 

Allows the buffer to be used as pointer.

Returns:
A pointer to the data in the buffer.

void* Frontend::Buffer::Pointer  )  [inline]
 

Allows the buffer to be used as pointer.

Returns:
A pointer to the data in the buffer.

void Frontend::Object::Release  )  [inherited]
 

Releases a reference on the object.

If you are an owner of an object, use this function to release it when you are done with it. The object will not be deleted until all owners have called Release() on it.

void Frontend::Buffer::Resize unsigned int  newSize  )  [inline]
 

Resizes the buffer.

If the buffer is enlarged, the data in the old buffer is copied into the first Size() bytes of the new buffer, the rest of the buffer will contain undefined data. If the buffer is shrinked, the old buffer is copied into the first newSize bytes of the new buffer. Overshooting data will be lost.

Parameters:
newSize New size of the buffer, in bytes.

unsigned int Frontend::Buffer::Size  )  [inline]
 

Returns the size of the buffer, in bytes.

Returns:
The size of the buffer, in bytes.


Member Data Documentation

UInt8* Frontend::Buffer::data [private]
 

unsigned int Frontend::Buffer::size [private]
 


The documentation for this class was generated from the following file: