ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Methods | Protected Fields | Protected Methods | List of all members
BitRWBase Class Reference

#include <bitbuffer.hpp>

Inheritance diagram for BitRWBase:
[legend]
Collaboration diagram for BitRWBase:
[legend]

Class Description


Non-instantiatable base class for types BitWriter and BitReader.

Definition at line 671 of file bitbuffer.hpp.

Public Methods

BitBufferBaseGetBuffer () const
 
BitBufferBase::Index GetIndex () const
 
uinteger RemainingSize () const
 
uinteger Usage () const
 

Protected Fields

BitBufferBasebb
 The bit buffer to write into. Provided on construction.
 
BitBufferBase::Index idx
 The current reading/writing index within bb.
 

Protected Methods

 BitRWBase (BitBufferBase &buffer)
 

Constructor & Destructor Documentation

◆ BitRWBase()

BitRWBase ( BitBufferBase buffer)
inlineexplicitprotected

Protected constructor, used by derived classes only.

Parameters
bufferThe bit buffer to work on.

Definition at line 681 of file bitbuffer.hpp.

Member Function Documentation

◆ GetBuffer()

BitBufferBase& GetBuffer ( ) const
inline

Retrieves the internal bit buffer.

Returns
The buffer the derived reader or writer works with.

Definition at line 690 of file bitbuffer.hpp.

◆ GetIndex()

BitBufferBase::Index GetIndex ( ) const
inline

Returns a copy of the current index in the bit buffer in respect to writing or reading progress of derived classes BitWriter BitReader. Such index elements may be passed to methods BitWriter::Reset(const BitBufferBase::Index&) and BitReader::Reset(const BitBufferBase::Index&)

Returns
The index of the next bit to write.

Definition at line 703 of file bitbuffer.hpp.

◆ RemainingSize()

uinteger RemainingSize ( ) const
inline

Invokes BitBufferBase::RemainingSize on the internal bit buffer, passing the result of GetIndex.

Returns
The number of bits dived by 8 remaining in this buffer.

Definition at line 722 of file bitbuffer.hpp.

Here is the call graph for this function:

◆ Usage()

uinteger Usage ( ) const
inline

Invokes BitBufferBase::Index::CountBits on the index returned by GetIndex.

Returns
The number of bits currently read from or written to the buffer.

Definition at line 712 of file bitbuffer.hpp.

Here is the call graph for this function:

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