Modules/SdSimulation/Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/G4OutputHandler.h
Go to the documentation of this file.
1 #ifndef _G4TankSimulatorASCII_G4OutputHandler_h_
2 #define _G4TankSimulatorASCII_G4OutputHandler_h_
3 
4 #include <utl/ErrorLogger.h>
5 #include <G4UIsession.hh>
6 #include <G4UImanager.hh>
7 #include <G4String.hh>
8 #include <boost/algorithm/string/trim.hpp>
9 
10 
11 namespace G4TankSimulatorASCII {
12 
20  class G4OutputHandler : public G4UIsession {
21 
22  public:
24  {
25  G4UImanager* const ui = G4UImanager::GetUIpointer();
26  ui->SetCoutDestination(this);
27  }
28 
30  {
31  G4UImanager* const ui = G4UImanager::GetUIpointer();
32  ui->SetCoutDestination(nullptr);
33  }
34 
35  G4int
36  ReceiveG4cout(const G4String& str)
37  override
38  {
39  G4String s = str;
41  LOGG4COUT(s);
42  return 0;
43  }
44 
45  G4int
46  ReceiveG4cerr(const G4String& str)
47  override
48  {
49  G4String s = str;
50  boost::algorithm::trim_right(s);
51  LOGG4CERR(s);
52  return 0;
53  }
54 
55  };
56 
57 }
58 
59 
60 #endif
constexpr double s
Definition: AugerUnits.h:163

, generated on Tue Sep 26 2023.