CbmRoot
CbmFormatMsHeaderPrintout.cxx
Go to the documentation of this file.
1 
3 
4 std::string
5 FormatMsHeaderPrintout(const fles::MicrosliceDescriptor& msDescriptor) {
6  std::stringstream ss;
7  ss << "hi hv eqid flag si sv idx/start crc size offset"
8  << std::endl
9  << std::hex << std::setfill('0') << std::setw(2)
10  << static_cast<unsigned int>(msDescriptor.hdr_id) << " " << std::setw(2)
11  << static_cast<unsigned int>(msDescriptor.hdr_ver) << " " << std::setw(4)
12  << msDescriptor.eq_id << " " << std::setw(4) << msDescriptor.flags << " "
13  << std::setw(2) << static_cast<unsigned int>(msDescriptor.sys_id) << " "
14  << std::setw(2) << static_cast<unsigned int>(msDescriptor.sys_ver) << " "
15  << std::setw(16) << msDescriptor.idx << " " << std::setw(8)
16  << msDescriptor.crc << " " << std::setw(8) << msDescriptor.size << " "
17  << std::setw(16) << msDescriptor.offset << std::dec << std::setfill(' ');
18  return ss.str();
19 }
20 
21 std::ostream& operator<<(std::ostream& os,
22  const fles::MicrosliceDescriptor& msDescriptor) {
23  char cPrevFill = os.fill('0');
24  return os << "hi hv eqid flag si sv idx/start crc size offset"
25  << std::endl
26  << std::hex << std::setfill('0') << std::setw(2)
27  << static_cast<unsigned int>(msDescriptor.hdr_id) << " "
28  << std::setw(2) << static_cast<unsigned int>(msDescriptor.hdr_ver)
29  << " " << std::setw(4) << msDescriptor.eq_id << " " << std::setw(4)
30  << msDescriptor.flags << " " << std::setw(2)
31  << static_cast<unsigned int>(msDescriptor.sys_id) << " "
32  << std::setw(2) << static_cast<unsigned int>(msDescriptor.sys_ver)
33  << " " << std::setw(16) << msDescriptor.idx << " " << std::setw(8)
34  << msDescriptor.crc << " " << std::setw(8) << msDescriptor.size
35  << " " << std::setw(16) << msDescriptor.offset << std::dec
36  << std::setfill(cPrevFill);
37 }
operator<<
std::ostream & operator<<(std::ostream &os, const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:21
FormatMsHeaderPrintout
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:5
CbmFormatMsHeaderPrintout.h