CommonMessaging< BASE > Class Template Reference

#include <GaudiKernel/CommonMessaging.h>

Inheritance diagram for CommonMessaging< BASE >:
Collaboration diagram for CommonMessaging< BASE >:

Public Types

using base_class = CommonMessaging
 

Protected Member Functions

void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Private Member Functions

void create_msgSvc () const override final
 cold functionality More...
 
void create_msgStream () const override final
 

Additional Inherited Members

- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const __attribute__((deprecated))
 Backward compatibility function for getting the output level. More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Detailed Description

template<typename BASE>
class CommonMessaging< BASE >

Definition at line 55 of file CommonMessaging.h.

Member Typedef Documentation

template<typename BASE>
using CommonMessaging< BASE >::base_class = CommonMessaging

Definition at line 165 of file CommonMessaging.h.

Member Function Documentation

template<typename BASE>
void CommonMessaging< BASE >::create_msgStream ( ) const
inlinefinaloverrideprivatevirtual

Implements CommonMessagingBase.

Definition at line 176 of file CommonMessaging.h.

176  {
177  auto& ms = msgSvc();
178  m_msgStream.reset(new MsgStream(ms, this->name()));
179  m_createMsgStream = (!ms.isValid() || !m_msgStream);
181  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:112
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
T reset(T...args)
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool m_createMsgStream
Flag to trigger a new MsgStream.
template<typename BASE>
void CommonMessaging< BASE >::create_msgSvc ( ) const
inlinefinaloverrideprivatevirtual

cold functionality

Implements CommonMessagingBase.

Definition at line 172 of file CommonMessaging.h.

172  {
173  // Get default implementation of the message service.
174  m_msgsvc = this->serviceLocator();
175  }
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
template<typename BASE>
void CommonMessaging< BASE >::updateMsgStreamOutputLevel ( int  level)
inlineprotected

Update the output level of the cached MsgStream.

This function is meant to be called by the update handler of the OutputLevel property.

Definition at line 186 of file CommonMessaging.h.

186  {
187  if (level != MSG::NIL && level != m_level) {
188  if (msgSvc()) {
189  msgSvc()->setOutputLevel(this->name(), level);
190  }
193  debug() << "Property update for OutputLevel : new value = " << level << endmsg;
195  }
196  }
#define UNLIKELY(x)
Definition: Kernel.h:126
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
void setLevel(int level)
Update outputlevel.
Definition: MsgStream.h:106
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.

The documentation for this class was generated from the following file: