| The Gaudi Framework v32r1 (f65d50dc)

InertMessageSvc.h
Go to the documentation of this file.
1 #ifndef MESSAGESVC_INERTMESSAGESVC_H
2 #define MESSAGESVC_INERTMESSAGESVC_H 1
3 // Include files
4 // FW
5 #include "MessageSvc.h"
6 // C++
7 #include <functional>
8 #include <memory>
9 #include <thread>
10 // External libs
11 #include "tbb/concurrent_queue.h"
12
26 class InertMessageSvc : public MessageSvc {
27 public:
29 using MessageSvc::MessageSvc;
30
32 StatusCode initialize() override;
33
35 StatusCode finalize() override;
36
37 using MessageSvc::reportMessage;
38
40 void reportMessage( const Message& msg ) override;
41
43 void reportMessage( const Message& msg, int outputLevel ) override;
44
46 void reportMessage( const StatusCode& code, const std::string& source = "" ) override;
47
48 private:
49 void m_activate();
50 void m_deactivate();
51 bool m_isActive = false;
52
53 tbb::concurrent_bounded_queue<std::function<void()>> m_messageActionsQueue;
54
55 std::thread m_thread;
56 };
57
58 #endif // MESSAGESVC_INERTMESSAGESVC_H
InertMessageSvc::initialize
StatusCode initialize() override
Initialization of the service.
Definition: InertMessageSvc.cpp:14
InertMessageSvc
Thread safe extension to the standard MessageSvc.
Definition: InertMessageSvc.h:26
std::function
InertMessageSvc::reportMessage
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
Definition: InertMessageSvc.cpp:67
MessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MessageSvc.cpp:78
InertMessageSvc::m_thread
std::thread m_thread
Definition: InertMessageSvc.h:55
MessageSvc.h
InertMessageSvc::finalize
StatusCode finalize() override
Finalization of the service.
std::string
STL class.
InertMessageSvc::m_deactivate
void m_deactivate()
Definition: InertMessageSvc.cpp:45
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:409
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
Definition: InertMessageSvc.h:53
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:113
Message
The Message class.
Definition: Message.h:17
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:566
InertMessageSvc::m_activate
void m_activate()
Definition: InertMessageSvc.cpp:34
InertMessageSvc::m_isActive
bool m_isActive
Definition: InertMessageSvc.h:51
MessageSvc
Definition: MessageSvc.h:30
std::thread
STL class.