ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
BitUnpacker.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$
14
15
16
#ifndef CXXUTILS_BITUNPACKER_H
17
#define CXXUTILS_BITUNPACKER_H
18
19
20
#include <stdint.h>
21
#include <cassert>
22
23
24
namespace
CxxUtils
{
25
26
37
template
<
class
STREAM>
38
class
BitUnpacker
39
{
40
public
:
46
BitUnpacker
(uint8_t nbits, STREAM& stream);
47
48
52
uint32_t
unpack
();
53
54
55
private
:
57
uint32_t
m_buf
;
58
60
uint8_t
m_nbuf
;
61
63
uint8_t
m_nbits
;
64
66
STREAM&
m_stream
;
67
69
uint32_t
m_mask
;
70
};
71
72
83
template
<
class
STREAM>
84
class
BitUnpacker8
85
{
86
public
:
91
BitUnpacker8
(STREAM& stream);
92
93
99
BitUnpacker8
(uint8_t nbits, STREAM& stream);
100
101
105
uint32_t
unpack
();
106
107
108
private
:
110
uint32_t
m_buf
;
111
113
uint8_t
m_nbuf
;
114
116
STREAM&
m_stream
;
117
};
118
119
130
template
<
class
STREAM>
131
class
BitUnpacker16
132
{
133
public
:
138
BitUnpacker16
(STREAM& stream);
139
140
146
BitUnpacker16
(uint8_t nbits, STREAM& stream);
147
148
152
uint32_t
unpack
();
153
154
155
private
:
157
uint32_t
m_buf
;
158
160
uint8_t
m_nbuf
;
161
163
STREAM&
m_stream
;
164
};
165
166
167
}
// namespace CxxUtils
168
169
170
#include "
CxxUtils/BitUnpacker.icc
"
171
172
173
#endif
// not CXXUTILS_BITUNPACKER_H
BitUnpacker.icc
CxxUtils::BitUnpacker16::BitUnpacker16
BitUnpacker16(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitUnpacker16::m_nbuf
uint8_t m_nbuf
Number of valid words currently buffered.
Definition
BitUnpacker.h:160
CxxUtils::BitUnpacker16::unpack
uint32_t unpack()
Unpack one value from the stream.
CxxUtils::BitUnpacker16::BitUnpacker16
BitUnpacker16(STREAM &stream)
Constructor.
CxxUtils::BitUnpacker16::m_stream
STREAM & m_stream
The input stream.
Definition
BitUnpacker.h:163
CxxUtils::BitUnpacker16::m_buf
uint32_t m_buf
Buffer for the current word being unpacked.
Definition
BitUnpacker.h:157
CxxUtils::BitUnpacker8::BitUnpacker8
BitUnpacker8(STREAM &stream)
Constructor.
CxxUtils::BitUnpacker8::unpack
uint32_t unpack()
Unpack one value from the stream.
CxxUtils::BitUnpacker8::BitUnpacker8
BitUnpacker8(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitUnpacker8::m_buf
uint32_t m_buf
Buffer for the current word being unpacked.
Definition
BitUnpacker.h:110
CxxUtils::BitUnpacker8::m_stream
STREAM & m_stream
The input stream.
Definition
BitUnpacker.h:116
CxxUtils::BitUnpacker8::m_nbuf
uint8_t m_nbuf
Number of valid bytes currently buffered.
Definition
BitUnpacker.h:113
CxxUtils::BitUnpacker::m_nbits
uint8_t m_nbits
Number of bits to use for each item.
Definition
BitUnpacker.h:63
CxxUtils::BitUnpacker::m_buf
uint32_t m_buf
Buffer for the current word being unpacked.
Definition
BitUnpacker.h:57
CxxUtils::BitUnpacker::m_mask
uint32_t m_mask
Mask with the low m_nbits bits set.
Definition
BitUnpacker.h:69
CxxUtils::BitUnpacker::unpack
uint32_t unpack()
Unpack one value from the stream.
CxxUtils::BitUnpacker::BitUnpacker
BitUnpacker(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitUnpacker::m_stream
STREAM & m_stream
The input stream.
Definition
BitUnpacker.h:66
CxxUtils::BitUnpacker::m_nbuf
uint8_t m_nbuf
Number of valid bits currently buffered.
Definition
BitUnpacker.h:60
CxxUtils
Definition
aligned_vector.h:29
Generated on
for ATLAS Offline Software by
1.17.0