The Gaudi Framework  v29r0 (ff2e7097)
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 ) : MessageSvc( name, pSvcLocator ) {}
19 
20 // ============================================================================
21 // Destructor
22 // ============================================================================
24 
25 // ============================================================================
26 // Initialization
27 // ============================================================================
29 {
30  StatusCode sc = MessageSvc::initialize(); // must be executed first
31  if ( sc.isFailure() ) return sc; // error printed already by MessageSvc
32 
33  return StatusCode::SUCCESS;
34 }
35 
36 // ============================================================================
37 // Finalize
38 // ============================================================================
40 {
41  return MessageSvc::finalize(); // must be called after all other actions
42 }
43 
45 {
46  m_messageQueue.add( new MessageWithLevel( *this, msg, outputLevel ) );
47 }
48 
50 
51 void TBBMessageSvc::reportMessage( const StatusCode& code, const std::string& source )
52 {
53  m_messageQueue.add( new StatusCodeMessage( *this, code, source ) );
54 }
55 
56 // ============================================================================
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:86
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:92
StatusCode initialize() override
Initialize Service.
Definition: MessageSvc.cpp:107
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
#define DECLARE_SERVICE_FACTORY(x)
Definition: Service.h:211
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:243
int outputLevel() const override
Definition: MessageSvc.cpp:592
StatusCode initialize() override
Initialization of the service.
Specialized class to report a message with implicit output level.
Definition: TBBMessageSvc.h:77
~TBBMessageSvc() override
Destructor.