The Gaudi Framework  master (37c0b60a)
InertMessageSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef MESSAGESVC_INERTMESSAGESVC_H
12 #define MESSAGESVC_INERTMESSAGESVC_H 1
13 // Include files
14 // FW
15 #include "MessageSvc.h"
16 // C++
17 #include <functional>
18 #include <memory>
19 #include <thread>
20 // External libs
21 #include <tbb/concurrent_queue.h>
22 
36 class InertMessageSvc : public MessageSvc {
37 public:
40 
42  StatusCode initialize() override;
43 
45  StatusCode finalize() override;
46 
48 
50  void reportMessage( const Message& msg ) override;
51 
53  void reportMessage( const Message& msg, int outputLevel ) override;
54 
56  void reportMessage( const StatusCode& code, std::string_view source = "" ) override;
57 
58 private:
59  void m_activate();
60  void m_deactivate();
61  bool m_isActive = false;
62 
63  tbb::concurrent_bounded_queue<std::function<void()>> m_messageActionsQueue;
64 
66 };
67 
68 #endif // MESSAGESVC_INERTMESSAGESVC_H
InertMessageSvc::m_isActive
bool m_isActive
Definition: InertMessageSvc.h:61
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:397
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
MessageSvc.h
std::function
InertMessageSvc
Definition: InertMessageSvc.h:36
InertMessageSvc::finalize
StatusCode finalize() override
Finalization of the service.
StatusCode
Definition: StatusCode.h:65
std::thread
STL class.
Message
Definition: Message.h:26
InertMessageSvc::m_deactivate
void m_deactivate()
Definition: InertMessageSvc.cpp:55
InertMessageSvc::initialize
StatusCode initialize() override
Initialization of the service.
Definition: InertMessageSvc.cpp:24
MessageSvc
Definition: MessageSvc.h:40
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:544
InertMessageSvc::m_activate
void m_activate()
Definition: InertMessageSvc.cpp:44
MessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MessageSvc.cpp:73
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
Definition: InertMessageSvc.h:63
InertMessageSvc::m_thread
std::thread m_thread
Definition: InertMessageSvc.h:65
InertMessageSvc::reportMessage
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
Definition: InertMessageSvc.cpp:77