![]()  | 
  
    ATLAS Offline Software
    
   | 
 
Pack a set of values bitwise into a stream. More...
#include <BitPacker.h>
Public Member Functions | |
| BitPacker16 (STREAM &stream) | |
| Constructor.  More... | |
| BitPacker16 (uint8_t nbits, STREAM &stream) | |
| Constructor.  More... | |
| ~BitPacker16 () | |
| Destructor.  More... | |
| void | pack (uint32_t x) | 
| Pack one value to the stream.  More... | |
Private Attributes | |
| uint32_t | m_buf | 
| Buffer for the current words being packed.  More... | |
| uint8_t | m_nbuf | 
| Number of valid words currently buffered.  More... | |
| STREAM & | m_stream | 
| The output stream.  More... | |
Pack a set of values bitwise into a stream.
This helper can be used to pack a set of values into 32-bit words and write them to a stream. This is a special case for 16-bit values.
STREAM should support output (operator<<) with uint32_t (satisfied by a ROOT TBuffer). 
Definition at line 146 of file BitPacker.h.
| CxxUtils::BitPacker16< STREAM >::BitPacker16 | ( | STREAM & | stream | ) | 
Constructor.
| nbits | Number of bits per item to use in the packed representation. | 
| stream | Output stream object. | 
| CxxUtils::BitPacker16< STREAM >::BitPacker16 | ( | uint8_t | nbits, | 
| STREAM & | stream | ||
| ) | 
Constructor.
| nbits | Must be 16. | 
| stream | Output stream object. | 
| CxxUtils::BitPacker16< STREAM >::~BitPacker16 | ( | ) | 
Destructor.
This may flush buffered data to the output stream.
| void CxxUtils::BitPacker16< STREAM >::pack | ( | uint32_t | x | ) | 
Pack one value to the stream.
| x | The value to pack. The upper bits should all be clear. | 
      
  | 
  private | 
Buffer for the current words being packed.
Definition at line 183 of file BitPacker.h.
      
  | 
  private | 
Number of valid words currently buffered.
Definition at line 186 of file BitPacker.h.
      
  | 
  private | 
The output stream.
Definition at line 189 of file BitPacker.h.
 1.8.18