ATLAS Offline Software
MessagePrinterOverlay.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef ASG_MESSAGING__MESSAGE_PRINTER_OVERLAY_H
10 #define ASG_MESSAGING__MESSAGE_PRINTER_OVERLAY_H
11 
12 namespace asg
13 {
14  class IMessagePrinter;
15 
27 
29  {
30  //
31  // public interface
32  //
33 
36 
37 
42  public:
43  MessagePrinterOverlay (IMessagePrinter *val_printer) noexcept;
44 
48  public:
49  ~MessagePrinterOverlay () noexcept;
50 
54  public:
55  static IMessagePrinter& current () noexcept;
56 
57 
58 
59  //
60  // private interface
61  //
62 
68  private:
69  static IMessagePrinter*& getCurrent () noexcept;
70 
72  private:
73  IMessagePrinter *m_saved = nullptr;
74 
76  private:
77  IMessagePrinter *m_current = nullptr;
78  };
79 }
80 
81 #endif
asg::MessagePrinterOverlay::operator=
MessagePrinterOverlay operator=(MessagePrinterOverlay &)=delete
asg
Definition: DataHandleTestTool.h:28
asg::MessagePrinterOverlay::MessagePrinterOverlay
MessagePrinterOverlay(MessagePrinterOverlay &)=delete
asg::MessagePrinterOverlay::getCurrent
static IMessagePrinter *& getCurrent() noexcept
get a reference to the pointer to the current IMessagePrinter
Definition: MessagePrinterOverlay.cxx:65
asg::MessagePrinterOverlay::m_saved
IMessagePrinter * m_saved
the stored message printer we need to restore
Definition: MessagePrinterOverlay.h:73
asg::MessagePrinterOverlay::current
static IMessagePrinter & current() noexcept
get the current IMessagePrinter
Definition: MessagePrinterOverlay.cxx:57
asg::MessagePrinterOverlay::~MessagePrinterOverlay
~MessagePrinterOverlay() noexcept
remove the currently overlaid printer
Definition: MessagePrinterOverlay.cxx:42
asg::MessagePrinterOverlay::m_current
IMessagePrinter * m_current
the current message printer we should have when we restore
Definition: MessagePrinterOverlay.h:77
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
asg::MessagePrinterOverlay
an object to change the IMessagePrinter temporarily
Definition: MessagePrinterOverlay.h:29