ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::bitbuffer::BitBuffer Class Reference

Description:

A bit buffer using dynamic allocation.

See also

Definition at line 345 of file bitbuffer.hpp.

#include <bitbuffer.hpp>

Inheritance diagram for alib::bitbuffer::BitBuffer:
[legend]
Collaboration diagram for alib::bitbuffer::BitBuffer:
[legend]

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))
TStorageData () const
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)
Index Terminate (Index writerIndex)
void ToLittleEndianEncoding (const Index &startIndex, const Index &endIndex)
Index Unterminate (Index terminationIndex)

Protected Field Index:

std::vector< TStoragestorage
 The vector that holds the data.
Protected Field Index: inherited from alib::bitbuffer::BitBufferBase
TStoragedata

Additional Inherited Members

Public Type Index: inherited from alib::bitbuffer::BitBufferBase
using TStorage = unsigned int

Field Details:

◆ storage

std::vector<TStorage> alib::bitbuffer::BitBuffer::storage
protected

The vector that holds the data.

Definition at line 348 of file bitbuffer.hpp.

Constructor(s) / Destructor Details:

◆ BitBuffer()

alib::bitbuffer::BitBuffer::BitBuffer ( uinteger initialCapacity)
inline

Constructor.

Parameters
initialCapacityThe requested initial capacity of the buffer in bits.

Definition at line 353 of file bitbuffer.hpp.

Here is the call graph for this function:

Method Details:

◆ Capacity()

virtual uinteger alib::bitbuffer::BitBuffer::Capacity ( ) const
inlineoverridevirtual

Returns the (currently allocated) capacity.

Returns
The size of the internal storage in bits.

Implements alib::bitbuffer::BitBufferBase.

Definition at line 357 of file bitbuffer.hpp.

◆ EnsureCapacity()

virtual bool alib::bitbuffer::BitBuffer::EnsureCapacity ( uinteger bitsRequired,
BitBufferBase::Index idx )
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.

Parameters
bitsRequiredThe number of bits required.
idxThe index of current buffer use.
Returns
true if the space is available or could be made available, false otherwise.

Implements alib::bitbuffer::BitBufferBase.

Definition at line 366 of file bitbuffer.hpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: