Base class of all buffers, represents an untyped array of bytes.
More...
#include <buffer.hh>
Base class of all buffers, represents an untyped array of bytes.
Constructs an empty buffer.
An empty buffer cannot be owned.
RawBuffer::RawBuffer |
( |
char * |
data, |
|
|
size_t |
offset, |
|
|
size_t |
len |
|
) |
| |
Constructor from unowned data.
RawBuffer::RawBuffer |
( |
size_t |
N, |
|
|
BufferOwner * |
owner = 0 |
|
) |
| |
Constructs a buffer and allocates N bytes.
RawBuffer::RawBuffer |
( |
const RawBuffer & |
other | ) |
|
RawBuffer::RawBuffer |
( |
const RawBuffer & |
other, |
|
|
size_t |
offset, |
|
|
size_t |
len |
|
) |
| |
Creates a new view on the buffer.
RawBuffer::~RawBuffer |
( |
| ) |
|
|
virtual |
size_t sdr::RawBuffer::bytesLen |
( |
| ) |
const |
|
inline |
Returns the size of the buffer by the view.
size_t sdr::RawBuffer::bytesOffset |
( |
| ) |
const |
|
inline |
Returns the offset of the data by the view.
char* sdr::RawBuffer::data |
( |
| ) |
const |
|
inline |
Returns the pointer to the data of the buffer view.
bool sdr::RawBuffer::isEmpty |
( |
| ) |
const |
|
inline |
Returns true if the buffer is invalid/empty.
bool sdr::RawBuffer::isUnused |
( |
| ) |
const |
|
inline |
We assume here that buffers are owned by one object: A buffer is therefore "unused" if the owner holds the only reference to the buffer.
char* sdr::RawBuffer::ptr |
( |
| ) |
const |
|
inline |
Returns the pointer to the data (w/o view).
void RawBuffer::ref |
( |
| ) |
const |
Increment reference counter.
int sdr::RawBuffer::refCount |
( |
| ) |
const |
|
inline |
Returns the reference counter.
size_t sdr::RawBuffer::storageSize |
( |
| ) |
const |
|
inline |
Returns the raw buffer size in bytes.
void RawBuffer::unref |
( |
| ) |
|
size_t sdr::RawBuffer::_b_length |
|
protected |
Holds the length of the buffer (view) in bytes.
size_t sdr::RawBuffer::_b_offset |
|
protected |
Holds the offset of the buffer in bytes.
Holds a weak reference the buffer owner.
char* sdr::RawBuffer::_ptr |
|
protected |
Holds the pointer to the data or 0, if buffer is empty.
int* sdr::RawBuffer::_refcount |
|
protected |
size_t sdr::RawBuffer::_storage_size |
|
protected |
Holds the size of the buffer in bytes.
The documentation for this class was generated from the following files:
- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/buffer.hh
- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/buffer.cc