ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CxxUtils::BitUnpacker8< STREAM > Class Template Reference

Helper to unpack a set of values bitwise from a stream. More...

#include <BitUnpacker.h>

Collaboration diagram for CxxUtils::BitUnpacker8< STREAM >:

Public Member Functions

 BitUnpacker8 (STREAM &stream)
 Constructor. More...
 
 BitUnpacker8 (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 bytes currently buffered. More...
 
STREAM & m_stream
 The input stream. More...
 

Detailed Description

template<class STREAM>
class CxxUtils::BitUnpacker8< STREAM >

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. This is a special case for 8-bit values.

STREAM should support input (operator>>) with uint32_t (satisfied by a ROOT TBuffer).

Definition at line 84 of file BitUnpacker.h.

Constructor & Destructor Documentation

◆ BitUnpacker8() [1/2]

template<class STREAM >
CxxUtils::BitUnpacker8< STREAM >::BitUnpacker8 ( STREAM &  stream)

Constructor.

Parameters
streamInput stream object.

◆ BitUnpacker8() [2/2]

template<class STREAM >
CxxUtils::BitUnpacker8< STREAM >::BitUnpacker8 ( uint8_t  nbits,
STREAM &  stream 
)

Constructor.

Parameters
nbitsMust be 8.
streamInput stream object.

Member Function Documentation

◆ unpack()

template<class STREAM >
uint32_t CxxUtils::BitUnpacker8< STREAM >::unpack ( )

Unpack one value from the stream.

Member Data Documentation

◆ m_buf

template<class STREAM >
uint32_t CxxUtils::BitUnpacker8< STREAM >::m_buf
private

Buffer for the current word being unpacked.

Definition at line 110 of file BitUnpacker.h.

◆ m_nbuf

template<class STREAM >
uint8_t CxxUtils::BitUnpacker8< STREAM >::m_nbuf
private

Number of valid bytes currently buffered.

Definition at line 113 of file BitUnpacker.h.

◆ m_stream

template<class STREAM >
STREAM& CxxUtils::BitUnpacker8< STREAM >::m_stream
private

The input stream.

Definition at line 116 of file BitUnpacker.h.


The documentation for this class was generated from the following file: