66 std::deque<bool> bits;
74 std::ostream &
Output(std::ostream &os)
const;
85 void push_back(
const unsigned char b,
const int bit_count = 8);
90 void push_back(
const unsigned short s,
const int bit_count = 16);
95 void push_back(
const unsigned long l,
const int bit_count = 32);
123 inline std::deque<bool> &
142 void hamming_enc_block(
unsigned long block_len, std::deque<bool>::iterator &iter);
143 int hamming_dec_block(
unsigned long block_len, std::deque<bool>::iterator &iter);
This file defines library export definitions, version numbers and build information.
An extended Bitset ( BitsetExt ) for handling e.g. Hamming encoding/decoding.
BitsetExt(bool _verbose)
Constructor.
int hamming_dec(int block_len)
Hamming decoding 'in-place' using the defined block length.
void SetVerbose(bool _verbose)
Set the verbose/silent mode.
static int count_hamming_dec_len(int block_len, int enc_len)
Count how many bits will be in the Bitset after hamming decoding.
static int count_hamming_enc_len(int block_len, int dec_len)
Count how many bits will be in the Bitset after hamming encoding.
void hamming_enc(int block_len)
Hamming encoding 'in-place' using the defined block length.
Bitset is a basic class for handling bit sequences
void flip(size_t pos)
Flip the selected bit.
bool pop_front()
Pop the front bit.
unsigned char uchar()
The Bitset as 'unsigned char'.
void push_back_meaningful(const unsigned long l)
Push back meaningful bits from 'long' l.
void push_back(const unsigned long l, const int bit_count=32)
Push back bit_count bits from 'long' l.
void fill_zeros_left(const size_t bit_count)
Fill the Bitset with non-meaningful zeros.
std::deque< bool > & GetBits()
The Bitset as 'deque<bool>'.
void clear()
Clear the bits.
bool pop_back()
Pop the back bit.
std::string hex()
The Bitset as a hex string.
int Length()
The length of the Bitset.
unsigned long ulong()
The Bitset as 'unsigned long'.
void push_back(const bool bit)
Push back one bit.
void push_back(const unsigned char b, const int bit_count=8)
Push back bit_count bits from 'byte' b.
std::ostream & Output(std::ostream &os) const
Output the bits to selected ostream.
void push_back(std::string s)
Push back a string of characters.
void push_back(const unsigned short s, const int bit_count=16)
Push back bit_count bits from 'short' s.