15#ifndef XSD_CXX_TREE_BUFFER_HXX
16#define XSD_CXX_TREE_BUFFER_HXX
47 operator delete (data_);
51 : data_ (0), size_ (0), capacity_ (0), free_ (
true)
156 bool assume_ownership);
278 end ()
const {
return data_ + size_;}
287 end () {
return data_ + size_;}
309 template <
typename C>
323 template <
typename C>
333#include <xsd/cxx/tree/buffer.txx>
Simple binary buffer abstraction.
Definition buffer.hxx:81
size_t size() const
Get buffer's size.
Definition buffer.hxx:215
char * data()
Get the underlying memory region.
Definition buffer.hxx:251
buffer(void *data, size_t size, size_t capacity, bool assume_ownership)
Reuse an existing buffer.
buffer(const void *data, size_t size)
Allocate a buffer of the specified size and copy the data.
const char * begin() const
Get the beginning of the underlying memory region.
Definition buffer.hxx:260
buffer(const void *data, size_t size, size_t capacity)
Allocate a buffer of the specified size and capacity and copy the data.
buffer(size_t size=0)
Allocate a buffer of the specified size.
buffer(size_t size, size_t capacity)
Allocate a buffer of the specified size and capacity.
buffer(const buffer &x)
Copy constructor.
bool size(size_t s)
Set buffer's size.
Definition buffer.hxx:224
buffer & operator=(const buffer &x)
Copy assignment operator.
size_t capacity() const
Get buffer's capacity.
Definition buffer.hxx:191
void swap(buffer &x)
Swap data with another buffer.
bool capacity(size_t c)
Set buffer's capacity.
Definition buffer.hxx:203
std::size_t size_t
Size type.
Definition buffer.hxx:86
const char * end() const
Get the end of the underlying memory region.
Definition buffer.hxx:278
char * begin()
Get the beginning of the underlying memory region.
Definition buffer.hxx:269
char * end()
Get the end of the underlying memory region.
Definition buffer.hxx:287
const char * data() const
Get the underlying memory region.
Definition buffer.hxx:243
Contains exception definitions for the C++/Tree mapping.
bool operator==(const buffer< C > &a, const buffer< C > &b)
buffer comparison operator.
Definition buffer.hxx:311
bool operator!=(const buffer< C > &a, const buffer< C > &b)
buffer comparison operator.
Definition buffer.hxx:325