aitools::invertedindex::ByteBuffer Class Reference

#include <ByteBuffer.hpp>

List of all members.

Public Member Functions

 ByteBuffer (size_t size=0) throw (std::bad_alloc)
 ByteBuffer (const ByteBuffer &buffer) throw (std::bad_alloc)
 ~ByteBuffer ()
size_t capacity () const
void clear ()
char * data ()
const char * data () const
bool empty () const
void free ()
ByteBufferoperator= (const ByteBuffer &buffer) throw (std::bad_alloc)
bool operator== (const ByteBuffer &buffer) const
bool operator!= (const ByteBuffer &buffer) const
void resize (size_t size) throw (std::bad_alloc)
size_t size () const

Private Attributes

char * data_
size_t capacity_
size_t size_

Detailed Description

A class template of a concrete Value. This class represents raw byte buffer.

Author:
martin.trenkmann@uni-weimar.de

Created on Jun 22, 2008

Id
ByteBuffer.hpp,v 1.28 2010/05/11 23:41:08 trenkman Exp

Definition at line 23 of file ByteBuffer.hpp.


Constructor & Destructor Documentation

aitools::invertedindex::ByteBuffer::ByteBuffer ( size_t  size = 0  )  throw (std::bad_alloc)

The explicit constructor. The byte buffer has a initial size of size.

Definition at line 4 of file ByteBuffer.cpp.

aitools::invertedindex::ByteBuffer::ByteBuffer ( const ByteBuffer buffer  )  throw (std::bad_alloc)

The copy constructor.

Definition at line 16 of file ByteBuffer.cpp.

aitools::invertedindex::ByteBuffer::~ByteBuffer (  ) 

The destructor.

Definition at line 28 of file ByteBuffer.cpp.


Member Function Documentation

size_t aitools::invertedindex::ByteBuffer::capacity (  )  const

Get the size of the allocated memory.

Returns:
the number of allocated bytes.

Definition at line 34 of file ByteBuffer.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

void aitools::invertedindex::ByteBuffer::clear (  ) 

Sets the internal buffer size to zero. Since the memory will not be deallocated, the capacity does not change.

Definition at line 40 of file ByteBuffer.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

const char * aitools::invertedindex::ByteBuffer::data (  )  const

Get read access to the allocated memory.

Returns:
a read-only pointer to the allocated memory.

Definition at line 52 of file ByteBuffer.cpp.

char * aitools::invertedindex::ByteBuffer::data (  ) 
bool aitools::invertedindex::ByteBuffer::empty (  )  const

Check if the buffer is empty.

Returns:
true if this buffer is empty, false otherwise.

Definition at line 58 of file ByteBuffer.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

void aitools::invertedindex::ByteBuffer::free (  ) 

Deallocate the entire buffer memory. The buffer has a size and capacity of 0 afterwards.

Definition at line 64 of file ByteBuffer.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

bool aitools::invertedindex::ByteBuffer::operator!= ( const ByteBuffer buffer  )  const

Definition at line 91 of file ByteBuffer.cpp.

ByteBuffer & aitools::invertedindex::ByteBuffer::operator= ( const ByteBuffer buffer  )  throw (std::bad_alloc)

The assignment operator with deep-copy behavior.

Definition at line 76 of file ByteBuffer.cpp.

bool aitools::invertedindex::ByteBuffer::operator== ( const ByteBuffer buffer  )  const

Definition at line 84 of file ByteBuffer.cpp.

void aitools::invertedindex::ByteBuffer::resize ( size_t  size  )  throw (std::bad_alloc)
size_t aitools::invertedindex::ByteBuffer::size (  )  const

Get the size of the byte array.

Returns:
the number of bytes stored.

Definition at line 113 of file ByteBuffer.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::ExternalMergeSort::swap_out(), and aitools::invertedindex::Value::wrap().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 105 of file ByteBuffer.hpp.

Definition at line 104 of file ByteBuffer.hpp.

Definition at line 106 of file ByteBuffer.hpp.


The documentation for this class was generated from the following files:
Generated on Wed May 30 15:07:32 2012 by  doxygen 1.6.3