LDMX Software
Packing
include
Packing
Utility
Hex.h
1
#ifndef PACKING_UTILITY_HEX_H_
2
#define PACKING_UTILITY_HEX_H_
3
4
#include <iomanip>
5
6
namespace
packing {
7
namespace
utility {
8
17
template
<
typename
WordType>
18
struct
Hex
{
19
static
const
std::size_t WIDTH{8 *
sizeof
(WordType)};
20
WordType& word_;
21
Hex
(WordType& w) : word_{w} {}
22
friend
inline
std::ostream& operator<<(
23
std::ostream& os,
const
packing::utility::Hex<WordType>
& h) {
24
os <<
"0x"
<< std::setfill(
'0'
) << std::setw(h.WIDTH) << std::hex << h.word_
25
<< std::dec;
26
return
os;
27
}
28
};
29
30
}
// namespace utility
31
}
// namespace packing
32
33
#endif
// PACKING_UTILITY_HEX_H_
packing::utility::Hex
Definition
Hex.h:18
Generated by
1.12.0