ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
asg::AsgMessagingForward Class Reference

base class to forward messages to another class More...

#include <AsgMessagingForward.h>

Inherited by CP::OutOfValidityEventHelper, CP::OutOfValidityHelper, CP::SysCopyHandle< T >, CP::SysFilterReporter, CP::SysFilterReporterCombiner, CP::SysFilterReporterParams, CP::SysHandleArray< HANDLE >, CP::SysListHandle, CP::SysReadDecorHandle< T >, CP::SysReadHandle< T >, CP::SysReadHandleArray< T >, CP::SysReadSelectionHandle, CP::SystematicsCache< CalibData >, CP::SysWriteDecorHandle< T >, CP::SysWriteHandle< T, Aux >, CP::SysWriteSelectionHandle, ElectronDNNCalculator, FilterReporterParams, CP::SysCopyHandle< const DataVector >, CP::SysCopyHandle< DataVector >, CP::SysCopyHandle< xAOD::MissingETContainer_v1 >, CP::SysHandleArray< SysReadSelectionHandle >, CP::SysReadDecorHandle< float >, CP::SysReadHandle< C >, CP::SysReadHandle< DataVector >, CP::SysReadHandle< xAOD::DiTauJetContainer >, CP::SysReadHandle< xAOD::ElectronContainer >, CP::SysReadHandle< xAOD::EventInfo_v1 >, CP::SysReadHandle< xAOD::JetContainer >, CP::SysReadHandle< xAOD::MissingETContainer_v1 >, CP::SysReadHandle< xAOD::MuonContainer >, CP::SysReadHandle< xAOD::PhotonContainer >, CP::SysReadHandle< xAOD::TauJetContainer >, CP::SystematicsCache< CP::MuonCalibIntSagittaTool::ParameterSetSagitta >, CP::SystematicsCache< CP::MuonCalibIntScaleSmearTool::ParameterSetScaleSmear >, CP::SystematicsCache< std::size_t >, CP::SysWriteDecorHandle< bool >, CP::SysWriteDecorHandle< char >, CP::SysWriteDecorHandle< double >, CP::SysWriteDecorHandle< ElementLink< DataVector > >, CP::SysWriteDecorHandle< float >, CP::SysWriteDecorHandle< int >, CP::SysWriteDecorHandle< std::vector< std::uint8_t > >, CP::SysWriteDecorHandle< TLorentzVector >, CP::SysWriteDecorHandle< uint32_t >, CP::SysWriteHandle< ConstDataVector< C > >, CP::SysWriteHandle< ConstDataVector< xAOD::DiTauJetContainer > >, CP::SysWriteHandle< ConstDataVector< xAOD::ElectronContainer > >, CP::SysWriteHandle< ConstDataVector< xAOD::JetContainer > >, CP::SysWriteHandle< ConstDataVector< xAOD::MuonContainer > >, CP::SysWriteHandle< ConstDataVector< xAOD::PhotonContainer > >, CP::SysWriteHandle< ConstDataVector< xAOD::TauJetContainer > >, CP::SysWriteHandle< DataVector >, and CP::SysWriteHandle< xAOD::MissingETContainer_v1, xAOD::MissingETAuxContainer_v1 >.

Collaboration diagram for asg::AsgMessagingForward:

Public Member Functions

template<typename T >
 AsgMessagingForward (T *owner)
 forwarding constructor More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 

Private Attributes

std::function< MsgStream &()> m_msg
 the message stream we use More...
 

Detailed Description

base class to forward messages to another class

The idea is that this class should closely mirror the behavior of AsgMessaging but instead of representing a named component in its own right, it forwards all the messages to another component. This is used for things like the systematics data handles that report all their messages as part of the owning algorithm.

Definition at line 28 of file AsgMessagingForward.h.

Constructor & Destructor Documentation

◆ AsgMessagingForward()

template<typename T >
asg::AsgMessagingForward::AsgMessagingForward ( T *  owner)
explicit

forwarding constructor

This is templated to allow arbitrary parent classes to be passed in here using the this pointer.

Definition at line 82 of file AsgMessagingForward.h.

84  : m_msg ([owner] () -> MsgStream& {return owner->msg();})
85  {}

Member Function Documentation

◆ msg() [1/2]

MsgStream & asg::AsgMessagingForward::msg ( ) const

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 24 of file AsgMessagingForward.cxx.

25  {
26  return m_msg();
27  }

◆ msg() [2/2]

MsgStream & asg::AsgMessagingForward::msg ( const MSG::Level  lvl) const

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 29 of file AsgMessagingForward.cxx.

30  {
31  MsgStream& msg = m_msg ();
32  msg << lvl;
33  return msg;
34  }

◆ msgLvl()

bool asg::AsgMessagingForward::msgLvl ( const MSG::Level  lvl) const

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 11 of file AsgMessagingForward.cxx.

12  {
13  MsgStream& msg = m_msg();
14  if (msg.level() <= lvl)
15  {
16  msg << lvl;
17  return true;
18  } else
19  {
20  return false;
21  }
22  }

Member Data Documentation

◆ m_msg

std::function<MsgStream& ()> asg::AsgMessagingForward::m_msg
private

the message stream we use

This used to be a simple pointer to the MsgStream itself, but in AthenaMT the actual object used is local to the thread. So instead of pointing to it directly we are now using a function to look it up, which will get the thread-local object.

Definition at line 77 of file AsgMessagingForward.h.


The documentation for this class was generated from the following files:
asg::AsgMessagingForward::m_msg
std::function< MsgStream &()> m_msg
the message stream we use
Definition: AsgMessagingForward.h:77
asg::AsgMessagingForward::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessagingForward.cxx:24