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

Description:

A bit buffer using monotonic allocation.

See also
Two alternatives are provided with BitBuffer and BitBufferLocal.

Definition at line 472 of file bitbuffer.inl.

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

Public Method Index:

 BitBufferMA (MonoAllocator &monoAllocator, uinteger initialCapacity)
 
virtual uinteger Capacity () const override
 
virtual bool EnsureCapacity (uinteger bitsRequired, BitBufferBase::Index idx) override
 
MonoAllocatorGetAllocator ()
 
- 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
 
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:

MonoAllocatorma
 
StdVectorMono< 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:

◆ ma

MonoAllocator& alib::bitbuffer::BitBufferMA::ma
protected

The monotonic allocator used internally to allocate the storage. This is provided with construction.

Definition at line 477 of file bitbuffer.inl.

◆ storage

StdVectorMono<TStorage> alib::bitbuffer::BitBufferMA::storage
protected

The vector that holds the data.

Definition at line 480 of file bitbuffer.inl.

Constructor(s) / Destructor Details:

◆ BitBufferMA()

alib::bitbuffer::BitBufferMA::BitBufferMA ( MonoAllocator & monoAllocator,
uinteger initialCapacity )
inline

Constructor taking an external monotonic allocator and the initial capacity.

Parameters
monoAllocatorA reference to a monotonic allocator to use to allocate buffer storage data.
initialCapacityThe requested initial capacity of the buffer in bits.

Definition at line 489 of file bitbuffer.inl.

Here is the call graph for this function:

Method Details:

◆ Capacity()

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

Returns the (currently allocated) capacity.

Returns
The size of the internal storage in bits.

Implements alib::bitbuffer::BitBufferBase.

Definition at line 501 of file bitbuffer.inl.

◆ EnsureCapacity()

virtual bool alib::bitbuffer::BitBufferMA::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 divided 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 515 of file bitbuffer.inl.

Here is the call graph for this function:

◆ GetAllocator()

MonoAllocator & alib::bitbuffer::BitBufferMA::GetAllocator ( )
inline

Returns the internal monotonic allocator for external use.

Returns
The monotonic allocator given on construction.

Definition at line 530 of file bitbuffer.inl.


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