Reference-counted buffer. More...
#include <Buffer.h>
Classes | |
struct | Clear |
Public Member Functions | |
template<typename InputIterator > | |
void | append (InputIterator start, InputIterator end) |
Buffer (const size_t size) | |
Buffer (const void *ptr, const size_t size) | |
Buffer (const std::string &str) | |
uint8_t * | data () |
const uint8_t * | data () const |
void | erase_first (size_t n) |
Erase the first n bytes. | |
operator ByteVector & () | |
operator const ByteVector & () const | |
void | resize (size_t new_size) |
size_t | size () const |
virtual | ~Buffer () |
Static Public Member Functions | |
static size_t | getDefaultBufferSize () |
static void | setDefaultBufferSize (size_t newSize) |
Private Member Functions | |
ByteVector & | buf () |
const ByteVector & | buf () const |
Private Attributes | |
ByteVector * | bufp |
Static Private Attributes | |
static size_t | defaultBufferSize = 128 |
static ADCHPP_DLL SimplePool < ByteVector, Clear > | pool |
Reference-counted buffer.
Definition at line 30 of file Buffer.h.
adchpp::Buffer::Buffer | ( | const std::string & | str | ) | [inline] |
adchpp::Buffer::Buffer | ( | const void * | ptr, | |
const size_t | size | |||
) | [inline] |
adchpp::Buffer::Buffer | ( | const size_t | size | ) | [inline] |
virtual adchpp::Buffer::~Buffer | ( | ) | [inline, virtual] |
Definition at line 56 of file Buffer.h.
References bufp, pool, and adchpp::SimplePool< T, Clear >::put().
void adchpp::Buffer::append | ( | InputIterator | start, | |
InputIterator | end | |||
) | [inline] |
ByteVector& adchpp::Buffer::buf | ( | ) | [inline, private] |
const ByteVector& adchpp::Buffer::buf | ( | ) | const [inline, private] |
Definition at line 60 of file Buffer.h.
References bufp.
Referenced by append(), data(), erase_first(), operator ByteVector &(), operator const ByteVector &(), resize(), and size().
uint8_t* adchpp::Buffer::data | ( | ) | [inline] |
const uint8_t* adchpp::Buffer::data | ( | ) | const [inline] |
void adchpp::Buffer::erase_first | ( | size_t | n | ) | [inline] |
static size_t adchpp::Buffer::getDefaultBufferSize | ( | ) | [inline, static] |
Definition at line 54 of file Buffer.h.
References defaultBufferSize.
Referenced by adchpp::Buffer::Clear::operator()().
adchpp::Buffer::operator ByteVector & | ( | ) | [inline] |
adchpp::Buffer::operator const ByteVector & | ( | ) | const [inline] |
void adchpp::Buffer::resize | ( | size_t | new_size | ) | [inline] |
static void adchpp::Buffer::setDefaultBufferSize | ( | size_t | newSize | ) | [inline, static] |
Definition at line 53 of file Buffer.h.
References defaultBufferSize.
size_t adchpp::Buffer::size | ( | ) | const [inline] |
ByteVector* adchpp::Buffer::bufp [private] |
size_t adchpp::Buffer::defaultBufferSize = 128 [static, private] |
Definition at line 58 of file Buffer.h.
Referenced by getDefaultBufferSize(), and setDefaultBufferSize().
SimplePool< ByteVector, Buffer::Clear > adchpp::Buffer::pool [static, private] |