scantools  1.0.4
Graphics manipulation with a view towards scanned documents
Public Member Functions | Public Attributes | List of all members
bitVector::miniBitVector Class Reference

Simple array of bits, useful for static data. More...

#include <bitVector.h>

Public Member Functions

quint8 getBit (int index) const
 Returns the bit at position index. More...
 

Public Attributes

quint8 numBits
 Number of bits stored, must be smaller than or equal to 32.
 
quint32 value
 Array of bits, there the least significant bit is the last of the bits stored.
 

Detailed Description

Simple array of bits, useful for static data.

This class provides a miniature array, storing at most 32 bits. It is mainly useful for storing arrays of bits statically, as in the following example.

bitVector::miniBitVector terminatingCodesWhite[] = {
{ 8, 0b00110101}, // Mini vector of size 8, with bits 0, 0, 1, 1, 0, 1, 0, 1
{ 6, 0b000111} // Mini vector of size 6, with bits 0, 0, 0, 1, 1, 1
};
Simple array of bits, useful for static data.
Definition: bitVector.h:128

Definition at line 128 of file bitVector.h.

Member Function Documentation

◆ getBit()

quint8 bitVector::miniBitVector::getBit ( int  index) const
inline

Returns the bit at position index.

Parameters
indexThis must be a valid index position in the bit array. In other words, index < numBits. Invalid values will likely lead to segfault
Returns
Either 0 or 1

Definition at line 144 of file bitVector.h.


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