The Gaudi Framework  master (ff829712)
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
 

Public Member Functions

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
 
- 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)
 

Protected Member Functions

MSG::Level setUpMessaging () const
 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.
 

Detailed Description

template<typename BASE>
class CommonMessaging< BASE >

Definition at line 139 of file CommonMessaging.h.

Member Typedef Documentation

◆ base_class

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

Definition at line 141 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 157 of file CommonMessaging.h.

157{ 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 160 of file CommonMessaging.h.

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

◆ msgLevel() [1/2]

template<typename BASE>
MSG::Level CommonMessaging< BASE >::msgLevel ( ) const
inline

get the cached level (originally extracted from the embedded MsgStream)

Definition at line 147 of file CommonMessaging.h.

147 {
148 if ( m_commonMessagingReady ) return m_level;
149 return setUpMessaging();
150 }
MSG::Level setUpMessaging() const
Set up local caches.

◆ msgLevel() [2/2]

template<typename BASE>
bool CommonMessaging< BASE >::msgLevel ( MSG::Level lvl) const
inline

get the output level from the embedded MsgStream

Definition at line 153 of file CommonMessaging.h.

153{ return msgLevel() <= lvl; }
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)

◆ resetMessaging()

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

Reinitialize internal states.

Definition at line 178 of file CommonMessaging.h.

178 {
180 return setUpMessaging();
181 }

◆ setUpMessaging()

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

Set up local caches.

Definition at line 173 of file CommonMessaging.h.

173 {
175 return m_level;
176 }
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 184 of file CommonMessaging.h.

184 {
186 if ( level != MSG::NIL && level != m_level ) {
187 if ( msgSvc() ) msgSvc()->setOutputLevel( this->name(), level );
188 if ( m_msgStream.get() ) m_msgStream->setLevel( level );
189 if ( MSG::Level( level ) <= MSG::DEBUG )
190 debug() << "Property update for OutputLevel : new value = " << level << endmsg;
192 }
193 }
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: