// G4Stream.cc // Contact person: A. Mastbaum // See G4Stream.hh for more details. //—————————————————————---------------------------------------------——// #include #include #include #include otext_streambuf warn_streambuf(&(RAT::warn)); otext_streambuf info_streambuf(&(RAT::info)); otext_streambuf detail_streambuf(&(RAT::detail)); otext_streambuf debug_streambuf(&(RAT::debug)); discard_streambuf discard; std::streambuf *g4cout_orig = G4cout.rdbuf(); std::streambuf *g4cerr_orig = G4cerr.rdbuf(); void SetG4coutStream(int i) { switch (i) { case G4Stream::WARN: G4cout.rdbuf(&warn_streambuf); break; case G4Stream::INFO: G4cout.rdbuf(&info_streambuf); break; case G4Stream::DETAIL: G4cout.rdbuf(&detail_streambuf); break; case G4Stream::DEBUG: G4cout.rdbuf(&debug_streambuf); break; case G4Stream::DISABLE: G4cout.rdbuf(&discard); break; default: G4cout.rdbuf(g4cout_orig); break; } } void SetG4cerrStream(int i) { switch (i) { case G4Stream::WARN: G4cerr.rdbuf(&warn_streambuf); break; case G4Stream::INFO: G4cerr.rdbuf(&info_streambuf); break; case G4Stream::DETAIL: G4cerr.rdbuf(&detail_streambuf); break; case G4Stream::DEBUG: G4cerr.rdbuf(&debug_streambuf); break; case G4Stream::DISABLE: G4cerr.rdbuf(&discard); break; default: G4cerr.rdbuf(g4cerr_orig); break; } }