ATLAS Offline Software
BitPacker.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef CXXUTILS_BITPACKER_H
17 #define CXXUTILS_BITPACKER_H
18 
19 
20 #include <stdint.h>
21 #include <cassert>
22 
23 
24 namespace CxxUtils {
25 
26 
37 template <class STREAM>
38 class BitPacker
39 {
40 public:
47 
48 
55 
56 
62  void pack (uint32_t x);
63 
64 
65 private:
68 
71 
74 
77 };
78 
79 
89 template <class STREAM>
91 {
92 public:
98 
99 
106 
107 
114 
115 
121  void pack (uint32_t x);
122 
123 
124 private:
127 
130 
133 };
134 
135 
145 template <class STREAM>
147 {
148 public:
155 
156 
163 
164 
171 
172 
178  void pack (uint32_t x);
179 
180 
181 private:
184 
187 
190 };
191 
192 
193 } // namespace CxxUtils
194 
195 
196 #include "CxxUtils/BitPacker.icc"
197 
198 
199 #endif // not CXXUTILS_BITPACKER_H
200 
CxxUtils::BitPacker8::m_stream
STREAM & m_stream
The output stream.
Definition: BitPacker.h:132
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
CxxUtils::BitPacker::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition: BitPacker.h:67
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CxxUtils::BitPacker16::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition: BitPacker.h:183
CxxUtils::BitPacker8::~BitPacker8
~BitPacker8()
Destructor.
x
#define x
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
CxxUtils::BitPacker8::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker16::~BitPacker16
~BitPacker16()
Destructor.
CxxUtils::BitPacker::BitPacker
BitPacker(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitPacker16::BitPacker16
BitPacker16(uint8_t nbits, STREAM &stream)
Constructor.
StateLessPT_NewConfig.STREAM
string STREAM
Definition: StateLessPT_NewConfig.py:23
CxxUtils::BitPacker8
Pack a set of values bitwise into a stream.
Definition: BitPacker.h:91
CxxUtils::BitPacker8::BitPacker8
BitPacker8(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitPacker::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker16::m_stream
STREAM & m_stream
The output stream.
Definition: BitPacker.h:189
CxxUtils
Definition: aligned_vector.h:29
CxxUtils::BitPacker8::BitPacker8
BitPacker8(STREAM &stream)
Constructor.
CxxUtils::BitPacker::m_nbits
uint8_t m_nbits
Number of bits to use for each item.
Definition: BitPacker.h:73
CxxUtils::BitPacker::~BitPacker
~BitPacker()
Destructor.
BitPacker.icc
CxxUtils::BitPacker8::m_nbuf
uint8_t m_nbuf
Number of valid bits currently buffered.
Definition: BitPacker.h:129
CxxUtils::BitPacker::m_stream
STREAM & m_stream
The output stream.
Definition: BitPacker.h:76
CxxUtils::BitPacker
Pack a set of values bitwise into a stream.
Definition: BitPacker.h:39
CxxUtils::BitPacker16
Pack a set of values bitwise into a stream.
Definition: BitPacker.h:147
CxxUtils::BitPacker16::BitPacker16
BitPacker16(STREAM &stream)
Constructor.
CxxUtils::BitPacker16::m_nbuf
uint8_t m_nbuf
Number of valid words currently buffered.
Definition: BitPacker.h:186
CxxUtils::BitPacker::m_nbuf
uint8_t m_nbuf
Number of valid bits currently buffered.
Definition: BitPacker.h:70
CxxUtils::BitPacker16::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker8::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition: BitPacker.h:126