#include <bitbuffer.hpp>
A bit buffer using dynamic allocation.
Definition at line 493 of file bitbuffer.hpp.
Public Methods | |
| BitBuffer (uinteger initialCapacity) | |
| virtual uinteger | Capacity () const override |
| virtual bool | EnsureCapacity (uinteger bitsRequired, BitBufferBase::Index idx) override |
Public Methods inherited from BitBufferBase | |
| BitBufferBase () noexcept | |
| virtual | ~BitBufferBase () |
| 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 Fields | |
| std::vector< TStorage > | storage |
Protected Fields inherited from BitBufferBase | |
| TStorage * | data |
Additional Inherited Members | |
Public Types inherited from BitBufferBase | |
| using | TStorage = unsigned int |
Constructor.
| initialCapacity | The requested initial capacity of the buffer in bits. |
Definition at line 504 of file bitbuffer.hpp.
|
inlineoverridevirtual |
Returns the (currently allocated) capacity.
Implements BitBufferBase.
Definition at line 513 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 required. |
| idx | The index of current buffer use. |
true if the the space is available or could be made available, false otherwise. Implements BitBufferBase.
Definition at line 527 of file bitbuffer.hpp.
|
protected |
The vector that holds the data.
Definition at line 497 of file bitbuffer.hpp.