8 #ifndef COMMONMESSAGING_H_
9 #define COMMONMESSAGING_H_
10 #include "GaudiKernel/IService.h"
11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/IMessageSvc.h"
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/SmartIF.h"
15 #include "GaudiKernel/GaudiException.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) {}
31 template <
typename A1,
typename A2>
CommonMessaging(
const A1& a1,
const A2& a2):
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();
136 mutable std::auto_ptr<MsgStream> m_msgStream;
139 mutable bool m_streamWithService;
143 void updateMsgStreamOutputLevel(
int level) {
144 if (m_msgStream.get()) m_msgStream->
setLevel(level);
Definition of the MsgStream class used to transmit messages.
TYPE * get() const
Get interface pointer.
void setLevel(int level)
Update outputlevel.
Templated class to add the standard messaging functionalities.