| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 <thread>
8 #include <functional>
9 #include <memory>
10 // External libs
11 #include "tbb/concurrent_queue.h"
12
26 class InertMessageSvc: public MessageSvc {
27 public:
29 InertMessageSvc(const std::string& name, ISvcLocator* pSvcLocator);
30
31 ~InertMessageSvc() override;
32
34 StatusCode initialize() override;
35
37 StatusCode finalize() override;
38
39 using MessageSvc::reportMessage;
40
42 void reportMessage(const Message& msg) override;
43
45 void reportMessage(const Message& msg, int outputLevel) override;
46
48 void reportMessage(const StatusCode& code, const std::string& source = "") override;
49
50 private:
51
52 void m_activate();
53 void m_deactivate();
54 bool m_isActive;
55
56 typedef std::function<void()> messageAction;
58 typedef std::shared_ptr<messageAction> messageActionPtr;
59 tbb::concurrent_bounded_queue<messageActionPtr> m_messageActionsQueue;
60
61 std::thread m_thread;
62
63 };
64
65 #endif // MESSAGESVC_INERTMESSAGESVC_H
InertMessageSvc::InertMessageSvc
InertMessageSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
Definition: InertMessageSvc.cpp:17
InertMessageSvc::initialize
StatusCode initialize() override
Initialization of the service.
Definition: InertMessageSvc.cpp:29
InertMessageSvc
Definition: InertMessageSvc.py:1
std::shared_ptr
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:132
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
std::function< void()>
InertMessageSvc::~InertMessageSvc
~InertMessageSvc() override
Destructor.
Definition: InertMessageSvc.cpp:24
InertMessageSvc::reportMessage
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
Definition: InertMessageSvc.cpp:89
InertMessageSvc::messageActionPtr
std::shared_ptr< messageAction > messageActionPtr
This is done since the copy of the lambda storage is too expensive.
Definition: InertMessageSvc.h:58
InertMessageSvc::m_thread
std::thread m_thread
Definition: InertMessageSvc.h:61
MessageSvc.h
InertMessageSvc::finalize
StatusCode finalize() override
Finalization of the service.
std::string
STL class.
InertMessageSvc::m_deactivate
void m_deactivate()
Definition: InertMessageSvc.cpp:65
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:408
Message
The Message class.
Definition: Message.h:15
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:576
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< messageActionPtr > m_messageActionsQueue
Definition: InertMessageSvc.h:59
InertMessageSvc::m_activate
void m_activate()
Definition: InertMessageSvc.cpp:54
InertMessageSvc::m_isActive
bool m_isActive
Definition: InertMessageSvc.h:54
MessageSvc
Definition: MessageSvc.h:30
std::thread
STL class.
InertMessageSvc::messageAction
std::function< void()> messageAction
Definition: InertMessageSvc.h:56