template<typename T>
sead::Buffer class

Public types

class constIterator
class iterator
class reverseIterator
using CompareCallback = s32(*)(const T*lhs, const T*rhs)

Constructors, destructors, conversion operators

Buffer()
Buffer(s32 size, T* buffer)
template<s32 N>
Buffer(T(&array)[N])
Buffer(const Buffer& other)

Public functions

auto operator=(const Buffer& other) -> Buffer&
auto begin() -> iterator
auto begin(s32 idx) -> iterator
auto begin() const -> constIterator
auto begin(s32 idx) const -> constIterator
auto end() -> iterator
auto end() const -> constIterator
auto rbegin() -> reverseIterator
auto rbegin(s32 index) -> reverseIterator
auto rend() -> reverseIterator
void allocBuffer(s32 size, s32 alignment)
void allocBuffer(s32 size, Heap* heap, s32 alignment = sizeof(void*))
auto tryAllocBuffer(s32 size, s32 alignment = sizeof(void*)) -> bool
auto tryAllocBuffer(s32 size, Heap* heap, s32 alignment = sizeof(void*)) -> bool
auto allocBufferAssert(s32 size, Heap* heap, s32 alignment = sizeof(void*)) -> bool
void freeBuffer()
void setBuffer(s32 size, T* bufferptr)
auto isBufferReady() const -> bool
auto isIndexValid(s32 idx) const -> bool
auto operator()(s32 idx) -> T&
auto operator()(s32 idx) const -> const T&
auto operator[](s32 idx) -> T&
auto operator[](s32 idx) const -> const T&
auto get(s32 idx) -> T*
auto get(s32 idx) const -> const T*
auto unsafeGet(s32 idx) -> T*
auto unsafeGet(s32 idx) const -> const T*
auto front() -> T&
auto front() const -> const T&
auto back() -> T&
auto back() const -> const T&
auto size() const -> s32
auto getSize() const -> s32
auto getBufferPtr() -> T*
auto getBufferPtr() const -> const T*
auto getByteSize() const -> u32
void fill(const T& v)
auto binarySearch(const T& item) const -> s32
auto binarySearch(const T& item, CompareCallback cmp) const -> s32
template<typename Key>
auto binarySearch(const Key& key, s32(*)(const T&item, const Key&key) cmp) const -> s32
template<typename CustomCompareCallback>
auto binarySearchC(CustomCompareCallback cmp) const -> s32
void heapSort(s32 start_idx, s32 end_idx)
Sort elements with indices in [start_idx .. end_idx] using heapsort.
void heapSort(s32 start_idx, s32 end_idx, CompareCallback cmp)
Sort elements with indices in [start_idx .. end_idx] using heapsort.

Protected static functions

static auto compareT(const T* lhs, const T* rhs) -> s32
static auto abs(s32 x) -> s32

Protected variables

s32 mSize
T* mBuffer