A bit buffer using dynamic allocation.
Definition at line 421 of file bitbuffer.inl.
Public Method Index: | |
| BitBuffer (uinteger initialCapacity) | |
| virtual uinteger | Capacity () const override |
| virtual bool | EnsureCapacity (uinteger bitsRequired, BitBufferBase::Index idx) override |
Public Method Index: inherited from alib::bitbuffer::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_DLL 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_DLL Index | Terminate (Index writerIndex) |
| ALIB_DLL void | ToLittleEndianEncoding (const Index &startIndex, const Index &endIndex) |
| ALIB_DLL Index | Unterminate (Index terminationIndex) |
Protected Field Index: | |
| std::vector< TStorage > | storage |
| The vector that holds the data. | |
Protected Field Index: inherited from alib::bitbuffer::BitBufferBase | |
| TStorage * | data |
Additional Inherited Members | |
Public Type Index: inherited from alib::bitbuffer::BitBufferBase | |
| using | TStorage = unsigned int |
|
protected |
The vector that holds the data.
Definition at line 425 of file bitbuffer.inl.
|
inline |
Constructor.
| initialCapacity | The requested initial capacity of the buffer in bits. |
Definition at line 432 of file bitbuffer.inl.
|
inlineoverridevirtual |
Returns the (currently allocated) capacity.
Implements alib::bitbuffer::BitBufferBase.
Definition at line 441 of file bitbuffer.inl.
|
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 space is available or could be made available, false otherwise. Implements alib::bitbuffer::BitBufferBase.
Definition at line 455 of file bitbuffer.inl.