8 #ifndef COMMONMESSAGING_H_
9 #define COMMONMESSAGING_H_
28 template <
typename A1,
typename A2,
typename A3>
CommonMessaging(
const A1& a1,
const A2& a2,
const A3& a3):
29 BASE(a1,a2,a3), m_streamWithService(false) {}
32 BASE(a1, a2), m_streamWithService(false) {}
35 BASE(a1), m_streamWithService(false) {}
38 BASE(), m_streamWithService(false) {}
47 virtual const std::string& name()
const = 0;
53 if (!m_msgsvc.get()) {
55 m_msgsvc = this->serviceLocator();
60 #if defined(GAUDI_V20_COMPAT) && !defined(G21_NO_DEPRECATED)
72 if (
UNLIKELY((!m_msgStream.get()) || (!m_streamWithService))) {
74 m_msgStream.reset(
new MsgStream(ms, this->name()));
75 m_streamWithService = ms.
get() != 0;
91 return msgStream() <<
level;
123 return msgStream().level();
144 if (m_msgStream.get()) m_msgStream->setLevel(level);
Definition of the MsgStream class used to transmit messages.
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
bool m_streamWithService
Flag to create a new MsgStream if it was created without the message service.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & err() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
CommonMessaging(const A1 &a1, const A2 &a2, const A3 &a3)
Templated constructor with 3 arguments.
MsgStream & msgStream() const
Return an uninitialized MsgStream.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
bool msgLevel(MSG::Level lvl) const
get the output level from the embedded MsgStream
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
MsgStream & msgStream(const MSG::Level level) const
Predefined configurable message stream for the efficient printouts.
CommonMessaging(const A1 &a1, const A2 &a2)
Templated constructor with 2 arguments.
TYPE * get() const
Get interface pointer.
virtual ~CommonMessaging()
Virtual destructor.
std::auto_ptr< MsgStream > m_msgStream
The predefined message stream.
Templated class to add the standard messaging functionalities.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
CommonMessaging(const A1 &a1)
Templated constructor with 1 argument.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
CommonMessaging()
Default constructor.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
CommonMessaging base_class
MSG::Level msgLevel() const
get the output level from the embedded MsgStream