The Gaudi Framework  v29r0 (ff2e7097)
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 
27 {
28 public:
30  InertMessageSvc( const std::string& name, ISvcLocator* pSvcLocator );
31 
32  ~InertMessageSvc() override;
33 
35  StatusCode initialize() override;
36 
38  StatusCode finalize() override;
39 
41 
43  void reportMessage( const Message& msg ) override;
44 
46  void reportMessage( const Message& msg, int outputLevel ) override;
47 
49  void reportMessage( const StatusCode& code, const std::string& source = "" ) override;
50 
51 private:
52  void m_activate();
53  void m_deactivate();
54  bool m_isActive;
55 
59  tbb::concurrent_bounded_queue<messageActionPtr> m_messageActionsQueue;
60 
62 };
63 
64 #endif // MESSAGESVC_INERTMESSAGESVC_H
InertMessageSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
StatusCode initialize() override
Initialization of the service.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
~InertMessageSvc() override
Destructor.
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
std::shared_ptr< messageAction > messageActionPtr
This is done since the copy of the lambda storage is too expensive.
std::thread m_thread
StatusCode finalize() override
Finalization of the service.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:424
The Message class.
Definition: Message.h:15
int outputLevel() const override
Definition: MessageSvc.cpp:592
tbb::concurrent_bounded_queue< messageActionPtr > m_messageActionsQueue
STL class.
std::function< void()> messageAction