Belle II Software development
|
Bit stream struct. More...
#include <BitStream.h>
Public Member Functions | |
BitStream () | |
Default constructor for ROOT. | |
BitStream (int n) | |
Constructor with the reserved and cleared storage prepared for incoming bits. | |
void | putNBits (unsigned int value, unsigned int n) |
Push n least significant bits of "value" to the stream. | |
unsigned int | getNBits (unsigned int n) |
Fetch n bits. | |
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 19 of file BitStream.h.
|
inline |
Default constructor for ROOT.
Current position is at beginning of the storage.
Definition at line 24 of file BitStream.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 beginning of the storage.
Definition at line 31 of file BitStream.h.
|
inline |
Fetch n bits.
Update current position accordingly
n | – how many bits fetch from the current position in the stream |
Definition at line 52 of file BitStream.h.
|
inline |
|
inline |
|
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 37 of file BitStream.h.
|
inline |
Resize data vector to the current position.
Definition at line 73 of file BitStream.h.
|
inline |
|
protected |
Current position in the storage.
Definition at line 78 of file BitStream.h.
|
protected |
The bit storage.
Definition at line 79 of file BitStream.h.