wibble  1.1
Public Member Functions | Protected Attributes | Friends | List of all members
wibble::sys::Buffer::Data Class Reference

#include <buffer.h>

Public Member Functions

 Data () throw ()
 
 Data (size_t size)
 
 Data (void *buf, size_t size, bool own=true)
 
 Data (const void *buf, size_t size)
 
 ~Data ()
 
void ref () const throw ()
 Increment the reference count for this object. More...
 
bool unref () const throw ()
 Decrement the reference count for this object, returning true when it reaches 0. More...
 
void resize (size_t size)
 Resize (enlarging or shrinking it) the buffer to `size' bytes. More...
 
bool operator== (const Data &d) const throw ()
 Compare the contents of two buffers. More...
 
bool operator< (const Data &d) const throw ()
 Compare the contents of two buffers. More...
 

Protected Attributes

int _ref
 
size_t _size
 
void * _data
 

Friends

class Buffer
 

Constructor & Destructor Documentation

◆ Data() [1/4]

wibble::sys::Buffer::Data::Data ( )
throw (
)
inline

◆ Data() [2/4]

wibble::sys::Buffer::Data::Data ( size_t  size)

References _data.

◆ Data() [3/4]

wibble::sys::Buffer::Data::Data ( void *  buf,
size_t  size,
bool  own = true 
)

References _data.

◆ Data() [4/4]

wibble::sys::Buffer::Data::Data ( const void *  buf,
size_t  size 
)

References _data.

◆ ~Data()

wibble::sys::Buffer::Data::~Data ( )

References _data.

Referenced by Data().

Member Function Documentation

◆ operator<()

bool wibble::sys::Buffer::Data::operator< ( const Data d) const
throw (
)

Compare the contents of two buffers.

References _data, and _size.

Referenced by unref().

◆ operator==()

bool wibble::sys::Buffer::Data::operator== ( const Data d) const
throw (
)

Compare the contents of two buffers.

References _data, and _size.

Referenced by wibble::sys::Buffer::operator!=(), and unref().

◆ ref()

void wibble::sys::Buffer::Data::ref ( ) const
throw (
)
inline

Increment the reference count for this object.

References _ref.

Referenced by wibble::sys::Buffer::Buffer(), wibble::sys::Buffer::operator=(), and wibble::sys::Buffer::resize().

◆ resize()

void wibble::sys::Buffer::Data::resize ( size_t  size)

Resize (enlarging or shrinking it) the buffer to `size' bytes.

References _data, _size, and wibble::sys::Buffer::size().

Referenced by wibble::sys::Buffer::resize(), and unref().

◆ unref()

bool wibble::sys::Buffer::Data::unref ( ) const
throw (
)
inline

Decrement the reference count for this object, returning true when it reaches 0.

References operator<(), operator==(), and resize().

Referenced by wibble::sys::Buffer::operator=(), wibble::sys::Buffer::resize(), and wibble::sys::Buffer::~Buffer().

Friends And Related Function Documentation

◆ Buffer

friend class Buffer
friend

Member Data Documentation

◆ _data

void* wibble::sys::Buffer::Data::_data
protected

◆ _ref

int wibble::sys::Buffer::Data::_ref
mutableprotected

Referenced by ref().

◆ _size

size_t wibble::sys::Buffer::Data::_size
protected

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