TBBMessageSvc.cpp
Go to the documentation of this file.
1 // Include files
2 
3 // From Gaudi
5 // local
6 #include "TBBMessageSvc.h"
7 
8 // ----------------------------------------------------------------------------
9 // Implementation file for class: TBBMessageSvc
10 //
11 // 22/06/2012: Marco Clemencic
12 // ----------------------------------------------------------------------------
14 
15 // ============================================================================
16 // Standard constructor, initializes variables
17 // ============================================================================
18 TBBMessageSvc::TBBMessageSvc(const std::string& name, ISvcLocator* pSvcLocator)
19  : MessageSvc(name, pSvcLocator)
20 {
21 }
22 
23 // ============================================================================
24 // Destructor
25 // ============================================================================
27 }
28 
29 // ============================================================================
30 // Initialization
31 // ============================================================================
33  StatusCode sc = MessageSvc::initialize(); // must be executed first
34  if ( sc.isFailure() ) return sc; // error printed already by MessageSvc
35 
36  return StatusCode::SUCCESS;
37 }
38 
39 // ============================================================================
40 // Finalize
41 // ============================================================================
43  return MessageSvc::finalize(); // must be called after all other actions
44 }
45 
47  m_messageQueue.add(new MessageWithLevel(*this, msg, outputLevel));
48 }
49 
51  m_messageQueue.add(new MessageWithoutLevel(*this, msg));
52 }
53 
54 void TBBMessageSvc::reportMessage(const StatusCode& code, const std::string& source) {
55  m_messageQueue.add(new StatusCodeMessage(*this, code, source));
56 }
57 
58 // ============================================================================
Gaudi::SerialTaskQueue m_messageQueue
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
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
STL namespace.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
STL class.
Specialized class to report a message with explicit output level.
Definition: TBBMessageSvc.h:62
Specialized class to report a StatusCode message.
Definition: TBBMessageSvc.h:90
StatusCode initialize() override
Initialize Service.
Definition: MessageSvc.cpp:82
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define DECLARE_SERVICE_FACTORY(x)
Definition: Service.h:242
StatusCode finalize() override
Finalization of the service.
The Message class.
Definition: Message.h:15
void add(WorkItem *item)
Enqueue a WorkItem for execution.
StatusCode finalize() override
Finalize Service.
Definition: MessageSvc.cpp:264
int outputLevel() const override
Definition: MessageSvc.cpp:621
StatusCode initialize() override
Initialization of the service.
Specialized class to report a message with implicit output level.
Definition: TBBMessageSvc.h:76
~TBBMessageSvc() override
Destructor.