The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
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
33public:
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
53private:
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};
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Thread safe extension to the standard MessageSvc.
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
StatusCode finalize() override
Finalization of the service.
StatusCode initialize() override
Initialization of the service.
std::thread m_thread
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
MessageSvc(const std::string &name, ISvcLocator *svcloc)
The Message class.
Definition Message.h:25
void reportMessage(const Message &message) override
int outputLevel() const override
MessageSvc(const std::string &name, ISvcLocator *svcloc)
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64