ATLAS Offline Software
|
Helper to unpack a set of values bitwise from a stream. More...
#include <BitUnpacker.h>
Public Member Functions | |
BitUnpacker (uint8_t nbits, STREAM &stream) | |
Constructor. More... | |
uint32_t | unpack () |
Unpack one value from the stream. More... | |
Private Attributes | |
uint32_t | m_buf |
Buffer for the current word being unpacked. More... | |
uint8_t | m_nbuf |
Number of valid bits currently buffered. More... | |
uint8_t | m_nbits |
Number of bits to use for each item. More... | |
STREAM & | m_stream |
The input stream. More... | |
uint32_t | m_mask |
Mask with the low m_nbits bits set. More... | |
Helper to unpack a set of values bitwise from a stream.
This helper can be used to unpack a set of values from a stream and return them as a set of 32-bit words. The number of bits taken by each value is configurable.
STREAM
should support input (operator>>) with uint32_t
(satisfied by a ROOT TBuffer).
Definition at line 38 of file BitUnpacker.h.
CxxUtils::BitUnpacker< STREAM >::BitUnpacker | ( | uint8_t | nbits, |
STREAM & | stream | ||
) |
Constructor.
nbits | Number of bits per item to use in the packed representation. |
stream | Input stream object. |
uint32_t CxxUtils::BitUnpacker< STREAM >::unpack | ( | ) |
Unpack one value from the stream.
|
private |
Buffer for the current word being unpacked.
Definition at line 57 of file BitUnpacker.h.
|
private |
Mask with the low m_nbits
bits set.
Definition at line 69 of file BitUnpacker.h.
|
private |
Number of bits to use for each item.
Definition at line 63 of file BitUnpacker.h.
|
private |
Number of valid bits currently buffered.
Definition at line 60 of file BitUnpacker.h.
|
private |
The input stream.
Definition at line 66 of file BitUnpacker.h.