CommonMessaging< BASE > Class Template Reference

#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/include/GaudiKernel/CommonMessaging.h>

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

Public Types

using base_class = CommonMessaging
 
using base_class = CommonMessaging
 

Public Member Functions

 ~CommonMessaging () override=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...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
 ~CommonMessaging () override=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...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Protected Member Functions

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

Protected Attributes

SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::unique_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService = false
 Flag to create a new MsgStream if it was created without the message service. More...
 

Detailed Description

template<typename BASE>
class CommonMessaging< BASE >

Definition at line 60 of file CommonMessaging.h.

Member Typedef Documentation

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

Definition at line 62 of file CommonMessaging.h.

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

Definition at line 62 of file CommonMessaging.h.

Constructor & Destructor Documentation

template<typename BASE>
CommonMessaging< BASE >::~CommonMessaging ( )
overridedefault

Virtual destructor.

template<typename BASE>
CommonMessaging< BASE >::~CommonMessaging ( )
overridedefault

Virtual destructor.

Member Function Documentation

template<typename BASE>
MsgStream& CommonMessaging< BASE >::always ( ) const
inline

shortcut for the method msgStream(MSG::ALWAYS)

Definition at line 116 of file CommonMessaging.h.

116 { return msgStream(MSG::ALWAYS); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::always ( ) const
inline

shortcut for the method msgStream(MSG::ALWAYS)

Definition at line 116 of file CommonMessaging.h.

116 { return msgStream(MSG::ALWAYS); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::debug ( ) const
inline

shortcut for the method msgStream(MSG::DEBUG)

Definition at line 134 of file CommonMessaging.h.

134 { return msgStream(MSG::DEBUG); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::debug ( ) const
inline

shortcut for the method msgStream(MSG::DEBUG)

Definition at line 134 of file CommonMessaging.h.

134 { return msgStream(MSG::DEBUG); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::err ( ) const
inline

shortcut for the method msgStream(MSG::ERROR)

Definition at line 122 of file CommonMessaging.h.

122 { return msgStream(MSG::ERROR); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::err ( ) const
inline

shortcut for the method msgStream(MSG::ERROR)

Definition at line 122 of file CommonMessaging.h.

122 { return msgStream(MSG::ERROR); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::error ( ) const
inline

shortcut for the method msgStream(MSG::ERROR)

Definition at line 125 of file CommonMessaging.h.

125 { return msgStream(MSG::ERROR); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::error ( ) const
inline

shortcut for the method msgStream(MSG::ERROR)

Definition at line 125 of file CommonMessaging.h.

125 { return msgStream(MSG::ERROR); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::fatal ( ) const
inline

shortcut for the method msgStream(MSG::FATAL)

Definition at line 119 of file CommonMessaging.h.

119 { return msgStream(MSG::FATAL); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::fatal ( ) const
inline

shortcut for the method msgStream(MSG::FATAL)

Definition at line 119 of file CommonMessaging.h.

119 { return msgStream(MSG::FATAL); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::info ( ) const
inline

shortcut for the method msgStream(MSG::INFO)

Definition at line 131 of file CommonMessaging.h.

131 { return msgStream(MSG::INFO); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::info ( ) const
inline

shortcut for the method msgStream(MSG::INFO)

Definition at line 131 of file CommonMessaging.h.

131 { return msgStream(MSG::INFO); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msg ( ) const
inline

shortcut for the method msgStream(MSG::INFO)

Definition at line 140 of file CommonMessaging.h.

140 { return msgStream(MSG::INFO); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msg ( ) const
inline

shortcut for the method msgStream(MSG::INFO)

Definition at line 140 of file CommonMessaging.h.

140 { return msgStream(MSG::INFO); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MSG::Level CommonMessaging< BASE >::msgLevel ( ) const
inline

get the output level from the embedded MsgStream

Definition at line 143 of file CommonMessaging.h.

143  {
144  return msgStream().level();
145  }
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:112
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MSG::Level CommonMessaging< BASE >::msgLevel ( ) const
inline

get the output level from the embedded MsgStream

Definition at line 143 of file CommonMessaging.h.

143  {
144  return msgStream().level();
145  }
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:112
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
bool CommonMessaging< BASE >::msgLevel ( MSG::Level  lvl) const
inline

get the output level from the embedded MsgStream

Definition at line 148 of file CommonMessaging.h.

148  {
149  return UNLIKELY(msgLevel() <= lvl);
150  }
#define UNLIKELY(x)
Definition: Kernel.h:126
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<typename BASE>
bool CommonMessaging< BASE >::msgLevel ( MSG::Level  lvl) const
inline

get the output level from the embedded MsgStream

Definition at line 148 of file CommonMessaging.h.

148  {
149  return UNLIKELY(msgLevel() <= lvl);
150  }
#define UNLIKELY(x)
Definition: Kernel.h:126
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msgStream ( ) const
inline

Return an uninitialized MsgStream.

Definition at line 92 of file CommonMessaging.h.

92  {
94  auto& ms = msgSvc();
95  m_msgStream.reset(new MsgStream(ms, this->name()));
96  m_streamWithService = ms.isValid();
97  }
98  return *m_msgStream;
99  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
bool m_streamWithService
Flag to create a new MsgStream if it was created without the message service.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
#define UNLIKELY(x)
Definition: Kernel.h:126
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msgStream ( ) const
inline

Return an uninitialized MsgStream.

Definition at line 92 of file CommonMessaging.h.

92  {
94  auto& ms = msgSvc();
95  m_msgStream.reset(new MsgStream(ms, this->name()));
96  m_streamWithService = ms.isValid();
97  }
98  return *m_msgStream;
99  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
bool m_streamWithService
Flag to create a new MsgStream if it was created without the message service.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
#define UNLIKELY(x)
Definition: Kernel.h:126
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msgStream ( const MSG::Level  level) const
inline

Predefined configurable message stream for the efficient printouts.

if ( a < 0 ) { msgStream( MSG::ERROR ) << "a = " << endmsg ; }
Returns
Reference to the predefined stream

Definition at line 111 of file CommonMessaging.h.

111  {
112  return msgStream() << level;
113  }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::msgStream ( const MSG::Level  level) const
inline

Predefined configurable message stream for the efficient printouts.

if ( a < 0 ) { msgStream( MSG::ERROR ) << "a = " << endmsg ; }
Returns
Reference to the predefined stream

Definition at line 111 of file CommonMessaging.h.

111  {
112  return msgStream() << level;
113  }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
SmartIF<IMessageSvc>& CommonMessaging< BASE >::msgSvc ( ) const
inline

The standard message service.

Returns a pointer to the standard message service.

Definition at line 73 of file CommonMessaging.h.

73  {
74  if (!m_msgsvc) {
75  // Get default implementation of the message service.
76  m_msgsvc = this->serviceLocator();
77  }
78  return m_msgsvc;
79  }
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
template<typename BASE>
SmartIF<IMessageSvc>& CommonMessaging< BASE >::msgSvc ( ) const
inline

The standard message service.

Returns a pointer to the standard message service.

Definition at line 73 of file CommonMessaging.h.

73  {
74  if (!m_msgsvc) {
75  // Get default implementation of the message service.
76  m_msgsvc = this->serviceLocator();
77  }
78  return m_msgsvc;
79  }
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 164 of file CommonMessaging.h.

164  {
165  if (m_msgStream) m_msgStream->setLevel(level);
166  }
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
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 164 of file CommonMessaging.h.

164  {
165  if (m_msgStream) m_msgStream->setLevel(level);
166  }
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::verbose ( ) const
inline

shortcut for the method msgStream(MSG::VERBOSE)

Definition at line 137 of file CommonMessaging.h.

137 { return msgStream(MSG::VERBOSE); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::verbose ( ) const
inline

shortcut for the method msgStream(MSG::VERBOSE)

Definition at line 137 of file CommonMessaging.h.

137 { return msgStream(MSG::VERBOSE); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::warning ( ) const
inline

shortcut for the method msgStream(MSG::WARNING)

Definition at line 128 of file CommonMessaging.h.

128 { return msgStream(MSG::WARNING); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<typename BASE>
MsgStream& CommonMessaging< BASE >::warning ( ) const
inline

shortcut for the method msgStream(MSG::WARNING)

Definition at line 128 of file CommonMessaging.h.

128 { return msgStream(MSG::WARNING); }
MsgStream & msgStream() const
Return an uninitialized MsgStream.

Member Data Documentation

template<typename BASE>
std::unique_ptr< MsgStream > CommonMessaging< BASE >::m_msgStream
mutableprotected

The predefined message stream.

Definition at line 157 of file CommonMessaging.h.

template<typename BASE>
SmartIF< IMessageSvc > CommonMessaging< BASE >::m_msgsvc
mutableprotected

Pointer to the message service;.

Definition at line 154 of file CommonMessaging.h.

template<typename BASE>
bool CommonMessaging< BASE >::m_streamWithService = false
mutableprotected

Flag to create a new MsgStream if it was created without the message service.

Definition at line 160 of file CommonMessaging.h.


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