|
| | HandleBuffer (Handle T::*member) |
| | Construct a new Handle Buffer object. More...
|
| |
| template<class Func > |
| void | forEach (const Func &&func) |
| |
| T * | at (const Handle &handle) |
| |
| Handle | create () |
| |
| Handle | push (const T &object) |
| | add element, may trigger resize More...
|
| |
| bool | pop (const Handle &handle, T *destination=nullptr) |
| |
| bool | remove (const Size index) |
| |
| bool | remove (const T &object) |
| |
| | HeapBuffer ()=default |
| |
| | HeapBuffer (const Size size) |
| | Setup the buffer with a size. More...
|
| |
| | HeapBuffer (const HeapBuffer< T, Alignment2, Allocator2, Size2 > &source) |
| | Copy Constructor, calls set() Failed allocations have to be checked. More...
|
| |
| | HeapBuffer (const T *data, Size size) |
| |
| | HeapBuffer (HeapBuffer &&source) |
| | Move contructor, will mark the original buffer as injected. More...
|
| |
| | HeapBuffer (const HeapBuffer *)=delete |
| |
| HeapBuffer & | operator= (HeapBuffer &&source) |
| |
| HeapBuffer & | operator= (const HeapBuffer &)=delete |
| |
| | ~HeapBuffer () |
| |
| bool | set (const HeapBuffer< T, Alignment2, Allocator2, Size2 > &source) |
| | Resizes and copies the contents of the source Buffer This will do a memory::copy,so none of the object contructors will called. More...
|
| |
| bool | set (const T *data, Size size) |
| | Set data from array. More...
|
| |
| void | inject (T *mem, const Size size, const Size realSize=0) |
| | Provide foreign memory to borrow. More...
|
| |
| void | inject (const T *mem, const Size size, const Size realSize=0) |
| | Provide const foreign memory to use Using non const accessors will cause assertions in debug mode. More...
|
| |
| void | disown () |
| | The memory is no longer manager by this instance. More...
|
| |
| bool | empty () const |
| |
| T * | data () |
| |
| const T * | data () const |
| |
| const T & | operator[] (const Size index) const |
| |
| T & | operator[] (const Size index) |
| |
| const T * | begin () const |
| |
| T * | begin () |
| |
| const T * | end () const |
| |
| T * | end () |
| |
| T & | last () |
| |
| T & | first () |
| |
| bool | reserve (const Size size) |
| | Will make sure the desired space is allocated. More...
|
| |
| bool | resize (const Size size, const bool downsize=true) |
| | Resize the buffer If the memory is borrowed it will become unique and owned by this instance as soon as an allocation happens. More...
|
| |
| bool | push (const T &object) |
| | Push the object to the back of the buffer TODO tklb move version. More...
|
| |
| bool | pop (T *object) |
| | Get the last element in the buffer. More...
|
| |
| bool | remove (const Size index) |
| | Removes the object at a given index and fills the gap with another Will never shrink the buffer/allocate. More...
|
| |
| bool | remove (const T &object) |
| | If a == comparisin is possible the object itself can be used. More...
|
| |
| bool | remove (const T *object) |
| | Otherwise use memory location. More...
|
| |
| bool | destroyPointers () |
| | If T is a pointer type, delete will be called for all pointers in buffer and resize(0) is called. More...
|
| |
| void | clear () |
| | Clears the buffer but doesn't free the memory. More...
|
| |
| bool | injected () const |
| | Whether the memory is managed by the instance or is borrowed. More...
|
| |
| Size | size () const |
| | Returns the amount of elements in the container. More...
|
| |
| Size | reserved () const |
| | Returns the real allocated size in elements. More...
|
| |
| Size | allocated () const |
| | Returns the size of the allocated space. More...
|
| |
template<class T, typename Handle = unsigned int, int MaskSplit = sizeof(Handle) * 4>
class tklb::HandleBuffer< T, Handle, MaskSplit >
TODO broken don't use.
A buffer to access contents via a Handle with validity checks
Type stored in here needs to store it's own id in a Handle member.
- Template Parameters
-
| T | type to store |
| Handle | type to index elements |
| MaskSplit | At what bit to split the Handle for validation |
Definition at line 15 of file THandleBuffer.hpp.