A bit buffer using monotonic allocation.
Definition at line 486 of file bitbuffer.hpp.
#include <bitbuffer.hpp>
Public Method Index: | |
BitBufferMA (MonoAllocator &monoAllocator, uinteger initialCapacity) | |
virtual uinteger | Capacity () const override |
virtual bool | EnsureCapacity (uinteger bitsRequired, BitBufferBase::Index idx) override |
MonoAllocator & | GetAllocator () |
Public Method Index: inherited from BitBufferBase | |
BitBufferBase () noexcept | |
Default Constructor (the only one). | |
virtual | ~BitBufferBase () |
Virtual destructor (does nothing, needed for abstract virtual class). | |
char * | CharStream (Index idx=Index(0, 0)) |
TStorage * | Data () const |
ALIB_API void | FromLittleEndianEncoding (const Index &startIndex, const Index &endIndex) |
TStorage | GetWord (const Index &index) const |
uinteger | RemainingSize (const Index &idx) const |
void | SetWord (const Index &index, TStorage value) |
ALIB_API Index | Terminate (Index writerIndex) |
ALIB_API void | ToLittleEndianEncoding (const Index &startIndex, const Index &endIndex) |
ALIB_API Index | Unterminate (Index terminationIndex) |
Protected Field Index: | |
MonoAllocator & | ma |
StdVectorMono< TStorage > | storage |
The vector that holds the data. | |
Protected Field Index: inherited from BitBufferBase | |
TStorage * | data |
Additional Inherited Members | |
Public Type Index: inherited from BitBufferBase | |
using | TStorage = unsigned int |
|
protected |
The monotonic allocator used internally to allocate the storage. This is provided with construction.
Definition at line 491 of file bitbuffer.hpp.
|
protected |
The vector that holds the data.
Definition at line 494 of file bitbuffer.hpp.
|
inline |
Constructor taking an external monotonic allocator and the initial capacity.
monoAllocator | A reference to a monotonic allocator to use to allocate buffer storage data. |
initialCapacity | The requested initial capacity of the buffer in bits. |
Definition at line 503 of file bitbuffer.hpp.
|
inlineoverridevirtual |
Returns the (currently allocated) capacity.
Implements BitBufferBase.
Definition at line 515 of file bitbuffer.hpp.
|
inlineoverridevirtual |
Checks if the given required storage space is internally reserved. If not, the internal capacity is doubled, or, if more is required, set to the required space.
bitsRequired | The number of bits divided required. |
idx | The index of current buffer use. |
true
if the space is available or could be made available, false
otherwise. Implements BitBufferBase.
Definition at line 529 of file bitbuffer.hpp.
|
inline |
Returns the internal monotonic allocator for external use.
Definition at line 544 of file bitbuffer.hpp.