CARMA C++
carma::util::ByteBuffer Class Reference

Manages a (possibly destructively) resizable buffer of raw bytes. More...

#include <carma/util/ByteBuffer.h>

Public Member Functions

 ByteBuffer ()
 Construct an empty buffer. More...
 
void destructiveReserve (size_t count)
 Reserve space in the buffer. More...
 
void destructiveResize (size_t count)
 Resize the buffer. More...
 
char * get () const
 Get the present pointer to the buffer. More...
 
size_t reserve () const
 Get the reserved size of the buffer. More...
 
size_t size () const
 Get the present size of the buffer. More...
 
void swap (ByteBuffer &rhs)
 Swap this instance with another ByteBuffer instance. More...
 
 ~ByteBuffer ()
 Destruct a ByteBuffer. More...
 

Detailed Description

Manages a (possibly destructively) resizable buffer of raw bytes.

It's sort of like a vector<char> with fewer methods and the caveat that if a resize or reserve operation needs to re-allocate the buffer then the values in the buffer are NOT guaranteed to be preserved.

Definition at line 16 of file ByteBuffer.h.

Constructor & Destructor Documentation

carma::util::ByteBuffer::ByteBuffer ( )
explicit

Construct an empty buffer.

Definition at line 69 of file ByteBuffer.h.

carma::util::ByteBuffer::~ByteBuffer ( )

Destruct a ByteBuffer.

Definition at line 78 of file ByteBuffer.h.

Member Function Documentation

void carma::util::ByteBuffer::destructiveReserve ( size_t  count)

Reserve space in the buffer.

If re-allocation is necessary then the values in the buffer are NOT guaranteed to be preserved

Definition at line 116 of file ByteBuffer.h.

void carma::util::ByteBuffer::destructiveResize ( size_t  count)

Resize the buffer.

If re-allocation is necessary then the values in the buffer are NOT guaranteed to be preserved

Definition at line 124 of file ByteBuffer.h.

char * carma::util::ByteBuffer::get ( ) const

Get the present pointer to the buffer.

Definition at line 95 of file ByteBuffer.h.

size_t carma::util::ByteBuffer::reserve ( ) const

Get the reserved size of the buffer.

Definition at line 109 of file ByteBuffer.h.

size_t carma::util::ByteBuffer::size ( ) const

Get the present size of the buffer.

Definition at line 102 of file ByteBuffer.h.

void carma::util::ByteBuffer::swap ( ByteBuffer rhs)

Swap this instance with another ByteBuffer instance.

Definition at line 86 of file ByteBuffer.h.


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