10 #ifndef __LArWheelCalculator_Impl_PortableMsgStream_H__
11 #define __LArWheelCalculator_Impl_PortableMsgStream_H__
12 #ifdef PORTABLE_LAR_SHAPE
22 class PortableMsgStream;
23 PortableMsgStream&
endmsg( PortableMsgStream&
s );
26 class PortableMsgStream {
36 template<
typename T> PortableMsgStream &
operator << (
const T &
t) {
37 if (m_level>=m_threshold) m_sstream <<
t;
41 PortableMsgStream&
operator<<( PortableMsgStream& ( *
t )(PortableMsgStream&)) {
43 if (m_level>=m_threshold) {
59 PortableMsgStream & doOutput() {
63 m_ostream <<
"VERBOSE: ";
66 m_ostream <<
"DEBUG : ";
69 m_ostream <<
"INFO : ";
72 m_ostream <<
"WARNING: ";
75 m_ostream <<
"ERROR : ";
78 m_ostream <<
"FATAL : ";
82 m_ostream << m_sstream.str() << std::endl;
91 PortableMsgStream (
const PortableMsgStream &) =
delete;
92 PortableMsgStream & operator=(
const PortableMsgStream &) =
delete;
94 std::ostringstream m_sstream;
95 std::ostream & m_ostream;
96 const std::string m_label;
101 inline PortableMsgStream&
endmsg( PortableMsgStream&
s ) {
return s.doOutput(); }
104 #endif //LAR_PORTABLE_SHAPE
105 #endif // __LArWheelCalculator_Impl_PortableMsgStream_H__