The Gaudi Framework  master (34daa81a)
Loading...
Searching...
No Matches
CommonMessaging< BASE > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/CommonMessaging.h>

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

Public Types

using base_class = CommonMessaging
 

Protected Member Functions

MSG::Level setUpMessaging () const override final
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

Private Member Functions

void create_msgStream () const override final
 cold functionality
 
void initMessaging () const
 Initialise the messaging objects.
 

Additional Inherited Members

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

Detailed Description

template<typename BASE>
class CommonMessaging< BASE >

Definition at line 150 of file CommonMessaging.h.

Member Typedef Documentation

◆ base_class

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

Definition at line 152 of file CommonMessaging.h.

Member Function Documentation

◆ create_msgStream()

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

cold functionality

Implements CommonMessagingBase.

Definition at line 159 of file CommonMessaging.h.

159{ m_msgStream.reset( new MsgStream( msgSvc(), this->name() ) ); }
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
boost::thread_specific_ptr< MsgStream > m_msgStream
The predefined message stream.

◆ initMessaging()

template<typename BASE>
void CommonMessaging< BASE >::initMessaging ( ) const
inlineprivate

Initialise the messaging objects.

Definition at line 162 of file CommonMessaging.h.

162 {
163 if ( !m_msgsvc ) {
164 // Get default implementation of the message service.
165 m_msgsvc = this->serviceLocator();
166 }
168 m_level = MSG::Level( m_msgStream.get() ? m_msgStream->level() : MSG::NIL );
169 // if we could not get a MessageSvc, we should try again the initial set up
171 }
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
void create_msgStream() const override final
cold functionality

◆ resetMessaging()

template<typename BASE>
MSG::Level CommonMessaging< BASE >::resetMessaging ( )
inlineprotected

Reinitialize internal states.

Definition at line 181 of file CommonMessaging.h.

181 {
183 return setUpMessaging();
184 }
MSG::Level setUpMessaging() const override final
Set up local caches.

◆ setUpMessaging()

template<typename BASE>
MSG::Level CommonMessaging< BASE >::setUpMessaging ( ) const
inlinefinaloverrideprotectedvirtual

Set up local caches.

Implements CommonMessagingBase.

Definition at line 175 of file CommonMessaging.h.

175 {
177 return m_level;
178 }
void initMessaging() const
Initialise the messaging objects.

◆ updateMsgStreamOutputLevel()

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 187 of file CommonMessaging.h.

187 {
189 if ( level != MSG::NIL && level != m_level ) {
190 if ( msgSvc() ) msgSvc()->setOutputLevel( this->name(), level );
191 if ( m_msgStream.get() ) m_msgStream->setLevel( level );
192 if ( MSG::Level( level ) <= MSG::DEBUG )
193 debug() << "Property update for OutputLevel : new value = " << level << endmsg;
195 }
196 }
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.

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