ATLAS Offline Software
getMessageSvc.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef ATHENAKERNEL_GETMESSAGESVC_H
8 #define ATHENAKERNEL_GETMESSAGESVC_H 1
9 
14 #include <cassert>
15 #include <string>
16 #include <atomic>
17 
18 class IMessageSvc;
19 namespace Athena {
20  namespace Options {
23  Lazy
24  };
25  }
38  IMessageSvc* getMessageSvc( bool quiet=false );
39  IMessageSvc* getMessageSvc( const Options::CreateOptions o, bool quiet=false );
40 
43  extern std::atomic<bool> getMessageSvcQuiet;
44 
46 
52  void reportMessage(IMessageSvc* ims, const std::string &source, int type, const std::string &message);
53  int outputLevel(const IMessageSvc* ims, const std::string &source);
54  void setOutputLevel(IMessageSvc* ims, const std::string &source, int level);
56 
61  public:
65 
70 
76  IMessageSvcHolder(IMessageSvc *ims);
77 
81 
85  IMessageSvc* get();
87  operator IMessageSvc*() { return this->get(); }
88  private:
89  IMessageSvc* m_ims;
90  };
91 }
92 
93 #endif
Athena::IMessageSvcHolder::m_ims
IMessageSvc * m_ims
Definition: getMessageSvc.h:89
Athena::Options::Lazy
@ Lazy
Definition: getMessageSvc.h:23
Athena::IMessageSvcHolder::~IMessageSvcHolder
~IMessageSvcHolder()
releases the IMessageSvc
Definition: getMessageSvc.cxx:83
Athena::IMessageSvcHolder
get a IMessageSvc* on 1st use (if not set) and release it on ~
Definition: getMessageSvc.h:60
Athena::IMessageSvcHolder::operator=
IMessageSvcHolder & operator=(const IMessageSvcHolder &)
Definition: getMessageSvc.cxx:68
Athena::getMessageSvcQuiet
std::atomic< bool > getMessageSvcQuiet
Set this to force off the warning messages from getMessageSvc (in unit tests, for example).
Definition: getMessageSvc.cxx:18
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
Athena::outputLevel
int outputLevel(const IMessageSvc *ims, const std::string &source)
Definition: getMessageSvc.cxx:47
ReweightUtils.message
message
Definition: ReweightUtils.py:15
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
Athena::IMessageSvcHolder::get
IMessageSvc * get()
upon first access sets m_ims as needed
Definition: getMessageSvc.cxx:88
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Athena::Options::CreateOptions
CreateOptions
Definition: getMessageSvc.h:21
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
Athena::setOutputLevel
void setOutputLevel(IMessageSvc *ims, const std::string &source, int level)
Definition: getMessageSvc.cxx:52
checkNSWValTree.Options
Options
Definition: checkNSWValTree.py:15
Athena::IMessageSvcHolder::IMessageSvcHolder
IMessageSvcHolder()
will take the IMessageSvc* lazily from getMessageSvc() in get() Slow, but useful for classes without ...
Definition: getMessageSvc.h:64
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Athena::Options::Eager
@ Eager
Definition: getMessageSvc.h:22
copySelective.source
string source
Definition: copySelective.py:32
Athena::reportMessage
void reportMessage(IMessageSvc *ims, const std::string &source, int type, const std::string &message)
Wrappers for some of the IMessageSvc methods These can be used from libraries without explicit Gaudi ...
Definition: getMessageSvc.cxx:43