![]() |
Belle II Software
release-06-00-14
|
Bit stream struct. More...
#include <ECLCompress.h>
Public Member Functions | |
BitStream () | |
Default constructor for ROOT. More... | |
BitStream (int n) | |
Constructor with the reserved and cleared storage prepared for incoming bits. More... | |
void | putNBits (unsigned int value, unsigned int n) |
Push n least significant bits of "value" to the stream. More... | |
unsigned int | getNBits (unsigned int n) |
Fetch n bits. More... | |
size_t | getPos () const |
Get current position in the stream. | |
void | setPos (size_t pos) |
Set position in the stream. | |
std::vector< unsigned int > & | getStore () |
Get data vector. | |
void | resize () |
Resize data vector to the current position. | |
Protected Attributes | |
size_t | m_pos |
Current position in the storage. | |
std::vector< unsigned int > | m_store |
The bit storage. | |
Bit stream struct.
Class contains vector of unsigned ints as a storage and current bit position in the storage. One can put and fetch up to 32 bits at once.
Definition at line 28 of file ECLCompress.h.
|
inline |
Default constructor for ROOT.
Current position is at begining of the storage.
Definition at line 33 of file ECLCompress.h.
|
inlineexplicit |
Constructor with the reserved and cleared storage prepared for incoming bits.
Be sure the size is enough for incoming data since the class does not check bounds. Current position is at begining of the storage.
Definition at line 40 of file ECLCompress.h.
|
inline |
Fetch n bits.
Update current position accordingly
n | – how many bits fetch from the current position in the stream |
Definition at line 61 of file ECLCompress.h.
|
inline |
Push n least significant bits of "value" to the stream.
Update current position accordingly.
value | – value to put in the stream |
n | – how many least signfificant bits of "value" put in the stream (n<=32) |
Definition at line 46 of file ECLCompress.h.