ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
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$
14
15
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
:
46
BitPacker
(uint8_t nbits, STREAM& stream);
47
48
54
~BitPacker
();
55
56
62
void
pack
(uint32_t
x
);
63
64
65
private
:
67
uint32_t
m_buf
;
68
70
uint8_t
m_nbuf
;
71
73
uint8_t
m_nbits
;
74
76
STREAM&
m_stream
;
77
};
78
79
89
template
<
class
STREAM>
90
class
BitPacker8
91
{
92
public
:
97
BitPacker8
(STREAM& stream);
98
99
105
BitPacker8
(uint8_t nbits, STREAM& stream);
106
107
113
~BitPacker8
();
114
115
121
void
pack
(uint32_t
x
);
122
123
124
private
:
126
uint32_t
m_buf
;
127
129
uint8_t
m_nbuf
;
130
132
STREAM&
m_stream
;
133
};
134
135
145
template
<
class
STREAM>
146
class
BitPacker16
147
{
148
public
:
154
BitPacker16
(STREAM& stream);
155
156
162
BitPacker16
(uint8_t nbits, STREAM& stream);
163
164
170
~BitPacker16
();
171
172
178
void
pack
(uint32_t
x
);
179
180
181
private
:
183
uint32_t
m_buf
;
184
186
uint8_t
m_nbuf
;
187
189
STREAM&
m_stream
;
190
};
191
192
193
}
// namespace CxxUtils
194
195
196
#include "
CxxUtils/BitPacker.icc
"
197
198
199
#endif
// not CXXUTILS_BITPACKER_H
200
BitPacker.icc
x
#define x
CxxUtils::BitPacker16::~BitPacker16
~BitPacker16()
Destructor.
CxxUtils::BitPacker16::m_nbuf
uint8_t m_nbuf
Number of valid words currently buffered.
Definition
BitPacker.h:186
CxxUtils::BitPacker16::BitPacker16
BitPacker16(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitPacker16::BitPacker16
BitPacker16(STREAM &stream)
Constructor.
CxxUtils::BitPacker16::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition
BitPacker.h:183
CxxUtils::BitPacker16::m_stream
STREAM & m_stream
The output stream.
Definition
BitPacker.h:189
CxxUtils::BitPacker16::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker8::m_stream
STREAM & m_stream
The output stream.
Definition
BitPacker.h:132
CxxUtils::BitPacker8::~BitPacker8
~BitPacker8()
Destructor.
CxxUtils::BitPacker8::BitPacker8
BitPacker8(uint8_t nbits, STREAM &stream)
Constructor.
CxxUtils::BitPacker8::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition
BitPacker.h:126
CxxUtils::BitPacker8::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker8::m_nbuf
uint8_t m_nbuf
Number of valid bits currently buffered.
Definition
BitPacker.h:129
CxxUtils::BitPacker8::BitPacker8
BitPacker8(STREAM &stream)
Constructor.
CxxUtils::BitPacker::m_nbuf
uint8_t m_nbuf
Number of valid bits currently buffered.
Definition
BitPacker.h:70
CxxUtils::BitPacker::m_buf
uint32_t m_buf
Buffer for the current words being packed.
Definition
BitPacker.h:67
CxxUtils::BitPacker::BitPacker
BitPacker(uint8_t nbits, 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.
CxxUtils::BitPacker::pack
void pack(uint32_t x)
Pack one value to the stream.
CxxUtils::BitPacker::m_stream
STREAM & m_stream
The output stream.
Definition
BitPacker.h:76
CxxUtils
Definition
aligned_vector.h:29
Generated on
for ATLAS Offline Software by
1.17.0