| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
CommonMessaging< BASE > Class Template Reference

`#include <GaudiKernel/CommonMessaging.h>`

Inheritance diagram for CommonMessaging< BASE >:
[legend]
Collaboration diagram for CommonMessaging< BASE >:
[legend]

## Public Types
using | base_class = CommonMessaging

## Public Member Functions
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Protected Member Functions
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Private Member Functions
void | create_msgStream () const override final
| cold functionality More...
void | initMessaging () const
| Initialise the messaging objects. More...

## Detailed Description

### template<typename BASE>
class CommonMessaging< BASE >

Definition at line 56 of file CommonMessaging.h.

## Member Typedef Documentation

## ◆ base_class

template<typename BASE>

using CommonMessaging< BASE >::base_class = CommonMessaging

Definition at line 132 of file CommonMessaging.h.

## Member Function Documentation

## ◆ create_msgStream()

template<typename BASE>

void CommonMessaging< BASE >::create_msgStream | ( |  | ) | const
| inline final override private virtual

cold functionality

Implements CommonMessagingBase.

Definition at line 153 of file CommonMessaging.h.

153 { m_msgStream.reset( new MsgStream( msgSvc(), this->name() ) ); }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:68
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
CommonMessagingBase::m_msgStream
boost::thread_specific_ptr< MsgStream > m_msgStream
The predefined message stream.
Definition: CommonMessaging.h:123

## ◆ initMessaging()

template<typename BASE>

void CommonMessaging< BASE >::initMessaging | ( |  | ) | const
| inline private

Initialise the messaging objects.

Definition at line 156 of file CommonMessaging.h.

156 {
157 if ( !m_msgsvc ) {
158 // Get default implementation of the message service.
159 m_msgsvc = this->serviceLocator();
160 }
161 create_msgStream();
162 m_level = MSG::Level( m_msgStream.get() ? m_msgStream->level() : MSG::NIL );
163 // if we could not get a MessageSvc, we should try again the initial set up
164 m_commonMessagingReady = m_msgsvc;
165 }
CommonMessagingBase::m_commonMessagingReady
bool m_commonMessagingReady
Definition: CommonMessaging.h:119
CommonMessaging::create_msgStream
void create_msgStream() const override final
cold functionality
Definition: CommonMessaging.h:153
CommonMessagingBase::m_msgsvc
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
Definition: CommonMessaging.h:126
MSG::Level
Level
Definition: IMessageSvc.h:15
CommonMessagingBase::m_level
MSG::Level m_level
Definition: CommonMessaging.h:120
MSG::NIL
Definition: IMessageSvc.h:15
CommonMessagingBase::m_msgStream
boost::thread_specific_ptr< MsgStream > m_msgStream
The predefined message stream.
Definition: CommonMessaging.h:123

## ◆ 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 138 of file CommonMessaging.h.

138 {
139 if ( LIKELY( m_commonMessagingReady ) ) return m_level;
140 return setUpMessaging();
141 }
CommonMessagingBase::m_commonMessagingReady
bool m_commonMessagingReady
Definition: CommonMessaging.h:119
CommonMessaging::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:169
CommonMessagingBase::m_level
MSG::Level m_level
Definition: CommonMessaging.h:120
LIKELY
#define LIKELY(x)
Definition: Kernel.h:95

## ◆ 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 149 of file CommonMessaging.h.

149 { return UNLIKELY( msgLevel() <= lvl ); }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
CommonMessaging::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:138

## ◆ outputLevel()

template<typename BASE>

MSG::Level CommonMessaging< BASE >::outputLevel | ( |  | ) | const
| inline

Backward compatibility function for getting the output level.

Definition at line 144 of file CommonMessaging.h.

144 {
145 return msgLevel();
146 }
CommonMessaging::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:138

## ◆ resetMessaging()

template<typename BASE>

MSG::Level CommonMessaging< BASE >::resetMessaging | ( |  | ) |
| inline protected

Reinitialize internal states.

Definition at line 174 of file CommonMessaging.h.

174 {
175 m_commonMessagingReady = false;
176 return setUpMessaging();
177 }
CommonMessagingBase::m_commonMessagingReady
bool m_commonMessagingReady
Definition: CommonMessaging.h:119
CommonMessaging::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:169

## ◆ setUpMessaging()

template<typename BASE>

MSG::Level CommonMessaging< BASE >::setUpMessaging | ( |  | ) | const
| inline protected

Set up local caches.

Definition at line 169 of file CommonMessaging.h.

169 {
170 if ( UNLIKELY( !m_commonMessagingReady ) ) { initMessaging(); }
171 return m_level;
172 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
CommonMessagingBase::m_commonMessagingReady
bool m_commonMessagingReady
Definition: CommonMessaging.h:119
CommonMessaging::initMessaging
void initMessaging() const
Initialise the messaging objects.
Definition: CommonMessaging.h:156
CommonMessagingBase::m_level
MSG::Level m_level
Definition: CommonMessaging.h:120

## ◆ updateMsgStreamOutputLevel()

template<typename BASE>

void CommonMessaging< BASE >::updateMsgStreamOutputLevel | ( | int | level | ) |
| inline protected

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

180 {
181 setUpMessaging();
182 if ( level != MSG::NIL && level != m_level ) {
183 if ( msgSvc() ) msgSvc()->setOutputLevel( this->name(), level );
184 if ( m_msgStream.get() ) m_msgStream->setLevel( level );
185 if ( UNLIKELY( MSG::Level( level ) <= MSG::DEBUG ) )
186 debug() << "Property update for OutputLevel : new value = " << level << endmsg;
187 m_level = MSG::Level( level );
188 }
189 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:68
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
MSG::DEBUG
Definition: IMessageSvc.h:15
CommonMessaging::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:169
MSG::Level
Level
Definition: IMessageSvc.h:15
CommonMessagingBase::m_level
MSG::Level m_level
Definition: CommonMessaging.h:120
MSG::NIL
Definition: IMessageSvc.h:15
CommonMessagingBase::m_msgStream
boost::thread_specific_ptr< MsgStream > m_msgStream
The predefined message stream.
Definition: CommonMessaging.h:123
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
gaudirun.level
level
Definition: gaudirun.py:334
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IMessageSvc::setOutputLevel
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.

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

- GaudiKernel/GaudiKernel/CommonMessaging.h