Honeycomb
0.1
Component-Model Framework
|
A contiguous region of referenced (not owned by object) memory. More...
#include <Buffer.h>
Public Types | |
typedef T | value_type |
typedef szt | size_type |
typedef sdt | difference_type |
typedef T & | reference |
typedef T * | pointer |
typedef T * | iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Public Member Functions | |
Buffer () | |
Construct empty buffer with null data and zero size. More... | |
Buffer (T *data, szt size) | |
Construct from memory reference and number of contiguous elements in region. More... | |
template<class U > | |
Buffer (vector< U > &list) | |
Construct from vector with compatible memory reference type. More... | |
template<class U > | |
Buffer (const vector< U > &list) | |
template<class U , szt N> | |
Buffer (array< U, N > &list) | |
Construct from array with compatible memory reference type. More... | |
template<class U , szt N> | |
Buffer (const array< U, N > &list) | |
Buffer (const Buffer &rhs) | |
Buffer (Buffer &&rhs) | |
Buffer & | operator= (const Buffer &rhs) |
Buffer & | operator= (Buffer &&rhs) |
T & | at (szt pos) const |
Access element with bounds checking, throws std::out_of_range. More... | |
T & | operator[] (szt pos) const |
Access element without bounds checking. More... | |
T & | front () const |
Returns the first element without bounds checking. More... | |
T & | back () const |
Returns the last element without bounds checking. More... | |
T * | data () const |
Get the referenced memory. More... | |
Buffer | slice (szt pos, optional< szt > size=optnull) const |
Get a view of this memory region in range [pos, pos+size) More... | |
T * | begin () const |
Returns an iterator to the beginning. More... | |
T * | end () const |
Returns an iterator to the end. More... | |
reverse_iterator | rbegin () const |
Returns a reverse iterator to the beginning. More... | |
reverse_iterator | rend () const |
Returns a reverse iterator to the end. More... | |
bool | empty () const |
Checks whether the buffer does not have any elements. More... | |
operator bool () const | |
Checks whether the buffer has elements. More... | |
szt | size () const |
Returns the number of elements. More... | |
bool | operator== (const Buffer &rhs) const |
Check if buffers reference same memory region. More... | |
bool | operator!= (const Buffer &rhs) const |
void | reset () |
Set data to null with zero size. More... | |
void | reset (T *data, szt size) |
Set new data and size. More... | |
operator Buffer< const T > () const | |
Implicitly convert to const buffer. More... | |
A contiguous region of referenced (not owned by object) memory.
A buffer is a light wrapper around a pointer, as such the constness of a buffer object does not affect the mutability of its referenced memory. Also, for readability it is better to pass a buffer by value instead of by const reference (eg. declare Buffer<T>
instead of const Buffer<T>&
, similar to how one would declare T*
instead of T* const&
).
typedef sdt honey::Buffer< T >::difference_type |
typedef T* honey::Buffer< T >::iterator |
typedef T* honey::Buffer< T >::pointer |
typedef T& honey::Buffer< T >::reference |
typedef std::reverse_iterator<iterator> honey::Buffer< T >::reverse_iterator |
typedef szt honey::Buffer< T >::size_type |
typedef T honey::Buffer< T >::value_type |
|
inline |
Construct empty buffer with null data and zero size.
|
inline |
Construct from memory reference and number of contiguous elements in region.
Construct from vector with compatible memory reference type.
|
inline |
Construct from array with compatible memory reference type.
|
inline |
|
inline |
|
inline |
|
inline |
Access element with bounds checking, throws std::out_of_range.
|
inline |
Returns the last element without bounds checking.
|
inline |
Returns an iterator to the beginning.
|
inline |
Get the referenced memory.
|
inline |
Checks whether the buffer does not have any elements.
|
inline |
Returns an iterator to the end.
|
inline |
Returns the first element without bounds checking.
|
inlineexplicit |
Checks whether the buffer has elements.
|
inline |
Implicitly convert to const buffer.
|
inline |
|
inline |
|
inline |
|
inline |
Check if buffers reference same memory region.
|
inline |
Access element without bounds checking.
|
inline |
Returns a reverse iterator to the beginning.
|
inline |
Returns a reverse iterator to the end.
|
inline |
Set data to null with zero size.
|
inline |
Set new data and size.
|
inline |
Returns the number of elements.
|
inline |
Get a view of this memory region in range [pos, pos+size)
The view will be clipped against the bounds of this region, possibly resulting in an empty view.