| The Gaudi Framework v30r0 (c919700c)

- 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 <functional>
8 #include <memory>
9 #include <thread>
10 // External libs
11 #include "tbb/concurrent_queue.h"
12
26 class InertMessageSvc : public MessageSvc
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
40 using MessageSvc::reportMessage;
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
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 #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:28
std::shared_ptr
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:121
InertMessageSvc
Thread safe extension to the standard MessageSvc.
Definition: InertMessageSvc.h:26
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:90
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:430
Message
The Message class.
Definition: Message.h:15
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:598
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< messageActionPtr > m_messageActionsQueue
Definition: InertMessageSvc.h:59
InertMessageSvc::m_activate
void m_activate()
Definition: InertMessageSvc.cpp:53
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