| The Gaudi Framework v27r1

- 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 virtual ~InertMessageSvc();
32
34 virtual StatusCode initialize();
35
37 virtual StatusCode finalize();
38
39 using MessageSvc::reportMessage;
40
42 virtual void reportMessage(const Message& msg);
43
45 virtual void reportMessage(const Message& msg, int outputLevel);
46
48 virtual void reportMessage(const StatusCode& code, const std::string& source = "");
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
Definition: InertMessageSvc.py:1
std::shared_ptr
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:133
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
std::function
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::~InertMessageSvc
virtual ~InertMessageSvc()
Destructor.
Definition: InertMessageSvc.cpp:24
std::string
STL class.
InertMessageSvc::m_deactivate
void m_deactivate()
Definition: InertMessageSvc.cpp:65
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
InertMessageSvc::reportMessage
virtual void reportMessage(const Message &msg)
Implementation of IMessageSvc::reportMessage()
Definition: InertMessageSvc.cpp:88
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:510
InertMessageSvc::initialize
virtual StatusCode initialize()
Initialization of the service.
Definition: InertMessageSvc.cpp:29
Message
The Message class.
Definition: Message.h:14
InertMessageSvc::m_messageActionsQueue
tbb::concurrent_bounded_queue< messageActionPtr > m_messageActionsQueue
Definition: InertMessageSvc.h:59
InertMessageSvc::finalize
virtual StatusCode finalize()
Finalization of the service.
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:693
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