ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include <cassert>
15#include <string>
16#include <atomic>
17
18class IMessageSvc;
19namespace Athena {
20 namespace Options {
25 }
26
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
~IMessageSvcHolder()
releases the IMessageSvc
IMessageSvcHolder()
will take the IMessageSvc* lazily from getMessageSvc() in get() Slow, but useful for classes without ...
IMessageSvcHolder & operator=(const IMessageSvcHolder &)
IMessageSvc * get()
upon first access sets m_ims as needed
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)
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 ...
std::atomic< bool > getMessageSvcQuiet
Set this to force off the warning messages from getMessageSvc (in unit tests, for example).
void setOutputLevel(IMessageSvc *ims, const std::string &source, int level)