![]() |
Project
|
#include <BitstreamReader.h>
Classes | |
class | Bits |
Helper class to get value of specified type which holds the number used bits. More... | |
Public Types | |
using | self_type = BitstreamReader< BufferType > |
using | value_type = BufferType |
using | iterator = const value_type * |
Public Member Functions | |
BitstreamReader ()=delete | |
BitstreamReader (iterator start, iterator end) | |
~BitstreamReader ()=default | |
bool | good () const |
bool | eof () const |
void | reset () |
Reset the reader, start over at beginning. | |
template<typename T , size_t N = sizeof(T) * 8> | |
size_t | peek (T &v) |
template<typename T > | |
size_t | peek (T &v, size_t bitlength) |
void | seek (size_t bitlength) |
template<typename T , size_t N = sizeof(T) * 8> | |
T | get () |
Get the next n bits and move the read position. | |
template<typename T > | |
T | get (size_t bitlength=sizeof(T) *8) |
Get the next n and move the read position. | |
template<typename T , std::enable_if_t< std::is_integral< T >::value, int > = 0> | |
self_type & | operator>> (T &target) |
Read an integral value from the stream. | |
template<size_t N> | |
self_type & | operator>> (std::bitset< N > &target) |
Read a bitstream value from the stream. | |
template<typename T > | |
self_type & | operator>> (Bits< T > &target) |
Read a Bits object from the stream. | |
Static Public Attributes | |
static constexpr size_t | value_size = sizeof(value_type) * 8 |
Definition at line 49 of file BitstreamReader.h.
using o2::algorithm::BitstreamReader< BufferType >::iterator = const value_type* |
Definition at line 56 of file BitstreamReader.h.
using o2::algorithm::BitstreamReader< BufferType >::self_type = BitstreamReader<BufferType> |
Definition at line 52 of file BitstreamReader.h.
using o2::algorithm::BitstreamReader< BufferType >::value_type = BufferType |
Definition at line 55 of file BitstreamReader.h.
|
delete |
|
inline |
Definition at line 59 of file BitstreamReader.h.
|
default |
|
inline |
Indicates end of data
Definition at line 74 of file BitstreamReader.h.
|
inline |
Get the next n bits and move the read position.
Definition at line 136 of file BitstreamReader.h.
|
inline |
Get the next n and move the read position.
Definition at line 146 of file BitstreamReader.h.
|
inline |
Check reader's state
Definition at line 67 of file BitstreamReader.h.
|
inline |
Read a Bits object from the stream.
Definition at line 233 of file BitstreamReader.h.
|
inline |
Read a bitstream value from the stream.
Definition at line 225 of file BitstreamReader.h.
|
inline |
Read an integral value from the stream.
Definition at line 217 of file BitstreamReader.h.
|
inline |
Get the next N bits without moving the read position if bitlength is smaller than the size of data type, result is aligned to LSB TODO: this also works nicely for bitsets, but then the bitlength has to be specified as template parameter, want to do a specific overload, but needs more work to catch all cases.
v | target variable passed by reference |
Definition at line 94 of file BitstreamReader.h.
|
inline |
Get the next n bits without moving the read position if bitlength is smaller than the size of data type, result is aligned to LSB
v | target variable passed by reference |
bitlength | number of bits to read |
Definition at line 106 of file BitstreamReader.h.
|
inline |
Reset the reader, start over at beginning.
Definition at line 80 of file BitstreamReader.h.
|
inline |
Move read position
bitlength | move count in number of bits |
Definition at line 113 of file BitstreamReader.h.
|
staticconstexpr |
Definition at line 57 of file BitstreamReader.h.