LDMX Software
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
packing::utility::hex< WordType > Struct Template Reference

A very simple wrapper enabling us to more easily tell the output stream to style the input word in hexidecimal format. More...

#include <Hex.h>

Public Member Functions

 hex (WordType &w)
 

Public Attributes

WordType & word_
 

Static Public Attributes

static const std::size_t width_ {8 * sizeof(WordType)}
 

Friends

std::ostream & operator<< (std::ostream &os, const packing::utility::hex< WordType > &h)
 

Detailed Description

template<typename WordType>
struct packing::utility::hex< WordType >

A very simple wrapper enabling us to more easily tell the output stream to style the input word in hexidecimal format.

Template Parameters

in] WordType type of word for styling

Definition at line 18 of file Hex.h.

Constructor & Destructor Documentation

◆ hex()

template<typename WordType >
packing::utility::hex< WordType >::hex ( WordType &  w)
inline

Definition at line 21 of file Hex.h.

21: word_{w} {}

Friends And Related Symbol Documentation

◆ operator<<

template<typename WordType >
std::ostream & operator<< ( std::ostream &  os,
const packing::utility::hex< WordType > &  h 
)
friend

Definition at line 22 of file Hex.h.

23 {
24 os << "0x" << std::setfill('0') << std::setw(h.width_) << std::hex
25 << h.word_ << std::dec;
26 return os;
27 }

Member Data Documentation

◆ width_

template<typename WordType >
const std::size_t packing::utility::hex< WordType >::width_ {8 * sizeof(WordType)}
static

Definition at line 19 of file Hex.h.

19{8 * sizeof(WordType)};

◆ word_

template<typename WordType >
WordType& packing::utility::hex< WordType >::word_

Definition at line 20 of file Hex.h.


The documentation for this struct was generated from the following file: