CbmRoot
Loading...
Searching...
No Matches
CbmErrorMessage.cxx
Go to the documentation of this file.
1/* Copyright (C) 2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
9#include "CbmErrorMessage.h"
10
11#include <iomanip> // for operator<<, setw
12#include <sstream> // for basic_ostream, operator<<, stringstream
13#include <string> // for char_traits
14
15// ----- Standard constructor ------------------------------------------
16CbmErrorMessage::CbmErrorMessage(ECbmModuleId sysId, double dTime, uint32_t uAddress, uint32_t uFlags,
17 uint32_t uPayload)
18 : fModuleId(sysId)
19 , fdTime(dTime)
20 , fuAddress(uAddress)
21 , fuFlags(uFlags)
22 , fuPayload(uPayload)
23{
24}
25// -------------------------------------------------------------------------
26
27
28// ----- Destructor ----------------------------------------------------
30// -------------------------------------------------------------------------
31
32
33// ----- Info to string ------------------------------------------------
34std::string CbmErrorMessage::ToString() const
35{
36 std::stringstream ss;
37 ss << "Error message: System " << GetSystemId() << " | time " << GetTime() << " | address " << GetAddress();
38 char cPrev = ss.fill('0');
39 ss << " | flags 0x" << std::hex << std::setw(8) << GetFlags() << std::dec << " | fulPayload 0x" << std::hex
40 << std::setw(8) << GetPayload() << std::dec;
41 ss.fill(cPrev);
42 return ss.str();
43}
44// -------------------------------------------------------------------------
45
46
ClassImp(CbmConverterManager)
ECbmModuleId
Definition CbmDefs.h:39
CbmRoot (+externals) headers.
uint32_t GetFlags() const
Flags (bitfield)
double GetTime() const
Absolute time [ns]
std::string ToString() const
Output information.
uint32_t GetAddress() const
Origin address
uint32_t GetPayload() const
Payload (optional)
ECbmModuleId GetSystemId() const
System (enum DetectorId)