clan::DataBuffer Class Reference

General purpose data buffer. More...

#include <databuffer.h>

Public Member Functions

 DataBuffer ()
 Constructs a data buffer of 0 size. More...
 
 DataBuffer (unsigned int size)
 
 DataBuffer (const void *data, unsigned int size)
 
 DataBuffer (const DataBuffer &data, unsigned int pos, unsigned int size)
 
 ~DataBuffer ()
 
unsigned int get_capacity () const
 Returns the capacity of the data buffer object. More...
 
char * get_data ()
 Returns a pointer to the data. More...
 
const char * get_data () const
 
template<typename Type >
Type * get_data ()
 
template<typename Type >
const Type * get_data () const
 
unsigned int get_size () const
 Returns the size of the data. More...
 
bool is_null () const
 Returns true if the buffer is 0 in size. More...
 
DataBufferoperator= (const DataBuffer &copy)
 
char & operator[] (int i)
 Returns a char in the buffer. More...
 
const char & operator[] (int i) const
 
char & operator[] (unsigned int i)
 
const char & operator[] (unsigned int i) const
 
void set_capacity (unsigned int capacity)
 Preallocate enough memory. More...
 
void set_size (unsigned int size)
 Resize the buffer. More...
 

Detailed Description

General purpose data buffer.

Constructor & Destructor Documentation

clan::DataBuffer::DataBuffer ( )

Constructs a data buffer of 0 size.

clan::DataBuffer::DataBuffer ( unsigned int  size)
clan::DataBuffer::DataBuffer ( const void *  data,
unsigned int  size 
)
clan::DataBuffer::DataBuffer ( const DataBuffer data,
unsigned int  pos,
unsigned int  size 
)
clan::DataBuffer::~DataBuffer ( )

Member Function Documentation

unsigned int clan::DataBuffer::get_capacity ( ) const

Returns the capacity of the data buffer object.

char* clan::DataBuffer::get_data ( )

Returns a pointer to the data.

const char* clan::DataBuffer::get_data ( ) const
template<typename Type >
Type* clan::DataBuffer::get_data ( )
inline

References get_data().

Referenced by get_data().

template<typename Type >
const Type* clan::DataBuffer::get_data ( ) const
inline

References get_data().

Referenced by get_data().

unsigned int clan::DataBuffer::get_size ( ) const

Returns the size of the data.

bool clan::DataBuffer::is_null ( ) const

Returns true if the buffer is 0 in size.

DataBuffer& clan::DataBuffer::operator= ( const DataBuffer copy)
char& clan::DataBuffer::operator[] ( int  i)

Returns a char in the buffer.

const char& clan::DataBuffer::operator[] ( int  i) const
char& clan::DataBuffer::operator[] ( unsigned int  i)
const char& clan::DataBuffer::operator[] ( unsigned int  i) const
void clan::DataBuffer::set_capacity ( unsigned int  capacity)

Preallocate enough memory.

void clan::DataBuffer::set_size ( unsigned int  size)

Resize the buffer.


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