The Gaudi Framework
master (bb4415cc)
Toggle main menu visibility
Loading...
Searching...
No Matches
InertMessageSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 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
:
34
using
MessageSvc::MessageSvc
;
35
37
StatusCode
initialize
()
override
;
38
40
StatusCode
finalize
()
override
;
41
42
using
MessageSvc::reportMessage
;
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
std::atomic<bool>
m_isActive
=
false
;
57
58
void
i_onSuppressChanged
(
bool
v )
override
{
59
m_messageActionsQueue
.emplace( [
this
, v] {
m_suppress
= v; } );
60
}
61
void
i_onDefaultFormatChanged
(
const
std::string& v )
override
{
62
m_messageActionsQueue
.emplace( [
this
, v] {
m_defaultFormat
= v; } );
63
}
64
tbb::concurrent_bounded_queue<std::function<void()>>
m_messageActionsQueue
;
65
66
std::thread
m_thread
;
67
};
MessageSvc.h
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition
CommonMessaging.h:124
InertMessageSvc
Thread safe extension to the standard MessageSvc.
Definition
InertMessageSvc.h:32
InertMessageSvc::i_onDefaultFormatChanged
void i_onDefaultFormatChanged(const std::string &v) override
Definition
InertMessageSvc.h:61
InertMessageSvc::reportMessage
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage().
Definition
InertMessageSvc.cpp:60
InertMessageSvc::finalize
StatusCode finalize() override
Finalization of the service.
InertMessageSvc::initialize
StatusCode initialize() override
Initialization of the service.
Definition
InertMessageSvc.cpp:15
InertMessageSvc::m_isActive
std::atomic< bool > m_isActive
Definition
InertMessageSvc.h:56
InertMessageSvc::m_thread
std::thread m_thread
Definition
InertMessageSvc.h:66
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
Definition
InertMessageSvc.h:64
InertMessageSvc::m_activate
void m_activate()
Definition
InertMessageSvc.cpp:32
InertMessageSvc::m_deactivate
void m_deactivate()
Definition
InertMessageSvc.cpp:41
InertMessageSvc::i_onSuppressChanged
void i_onSuppressChanged(bool v) override
Definition
InertMessageSvc.h:58
InertMessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition
MessageSvc.cpp:65
Message
The Message class.
Definition
Message.h:25
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition
MessageSvc.cpp:358
MessageSvc::outputLevel
int outputLevel() const override
Definition
MessageSvc.cpp:434
MessageSvc::m_defaultFormat
std::string m_defaultFormat
Definition
MessageSvc.h:138
MessageSvc::m_suppress
bool m_suppress
Definition
MessageSvc.h:137
MessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition
MessageSvc.cpp:65
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
GaudiCoreSvc
src
MessageSvc
InertMessageSvc.h
Generated on
for The Gaudi Framework by
1.17.0