The Gaudi Framework  master (d98a2936)
InertMessageSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
13 #include "MessageSvc.h"
14 #include <functional>
15 #include <memory>
16 #include <tbb/concurrent_queue.h>
17 #include <thread>
18 
32 class InertMessageSvc : public MessageSvc {
33 public:
35 
37  StatusCode initialize() override;
38 
40  StatusCode finalize() override;
41 
43 
45  void reportMessage( const Message& msg ) override;
46 
48  void reportMessage( const Message& msg, int outputLevel ) override;
49 
51  void reportMessage( const StatusCode& code, std::string_view source = "" ) override;
52 
53 private:
54  void m_activate();
55  void m_deactivate();
56  bool m_isActive = false;
57 
58  tbb::concurrent_bounded_queue<std::function<void()>> m_messageActionsQueue;
59 
60  std::thread m_thread;
61 };
InertMessageSvc::m_isActive
bool m_isActive
Definition: InertMessageSvc.h:56
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:357
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
MessageSvc.h
InertMessageSvc
Definition: InertMessageSvc.h:32
InertMessageSvc::finalize
StatusCode finalize() override
Finalization of the service.
StatusCode
Definition: StatusCode.h:64
Message
Definition: Message.h:25
InertMessageSvc::m_deactivate
void m_deactivate()
Definition: InertMessageSvc.cpp:40
InertMessageSvc::initialize
StatusCode initialize() override
Initialization of the service.
Definition: InertMessageSvc.cpp:15
MessageSvc
Definition: MessageSvc.h:35
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:428
InertMessageSvc::m_activate
void m_activate()
Definition: InertMessageSvc.cpp:31
MessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MessageSvc.cpp:64
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
Definition: InertMessageSvc.h:58
InertMessageSvc::m_thread
std::thread m_thread
Definition: InertMessageSvc.h:60
InertMessageSvc::reportMessage
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
Definition: InertMessageSvc.cpp:59