Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TBBMessageSvc.h
Go to the documentation of this file.
1 #ifndef MESSAGESVC_TBBMESSAGESVC_H
2 #define MESSAGESVC_TBBMESSAGESVC_H 1
3 // Include files
4 #include "MessageSvc.h"
5 
7 
8 // just needed for the thread id
9 #include <thread>
10 
11 #include <thread>
12 
20 class TBBMessageSvc : public MessageSvc {
21 public:
23 
25 
27  void reportMessage( const Message& msg ) override;
28 
30  void reportMessage( const Message& msg, int outputLevel ) override;
31 
33  void reportMessage( const StatusCode& code, const std::string& source = "" ) override;
34 
35 private:
36  // ============================================================================
37  // Helper tasks for message reporting.
38  // ============================================================================
41  public:
42  MessageTaskCommon( TBBMessageSvc& svc ) : m_svc( svc ), m_sender( std::this_thread::get_id() ) {}
43 
44  protected:
47  };
48 
51  public:
53  : MessageTaskCommon( svc ), m_msg( msg ), m_level( level ) {}
54  void run() override { m_svc.i_reportMessage( m_msg, m_level ); }
55 
56  private:
58  int m_level;
59  };
60 
63  public:
64  MessageWithoutLevel( TBBMessageSvc& svc, Message msg ) : MessageTaskCommon( svc ), m_msg( msg ) {}
65  void run() override {
66  const int level = m_svc.outputLevel( m_msg.getSource() );
67  m_svc.i_reportMessage( m_msg, level );
68  }
69 
70  private:
72  };
73 
76  public:
77  StatusCodeMessage( TBBMessageSvc& svc, const StatusCode& sc, const std::string& source )
78  : MessageTaskCommon( svc ), m_sc( sc ), m_source( source ) {}
79  void run() override { m_svc.i_reportMessage( m_sc, m_source ); }
80 
81  private:
84  };
85 
87 };
88 
89 #endif // MESSAGESVC_TBBMESSAGESVC_H
Gaudi::SerialTaskQueue m_messageQueue
Definition: TBBMessageSvc.h:86
void run() override
Method to be implemented by the actual task classes.
Definition: TBBMessageSvc.h:79
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
virtual void i_reportMessage(const Message &msg, int outputLevel)
Internal implementation of reportMessage(const Message&,int) without lock.
Definition: MessageSvc.cpp:353
void run() override
Method to be implemented by the actual task classes.
Definition: TBBMessageSvc.h:65
void reportMessage(const Message &msg) override
Implementation of IMessageSvc::reportMessage()
Base class for the task to be executed by the serial queue.
STL namespace.
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MessageSvc.cpp:78
Class for a generic serial queue of tasks (modeled on the Intel Threading Building Blocks Design Patt...
MessageWithoutLevel(TBBMessageSvc &svc, Message msg)
Definition: TBBMessageSvc.h:64
STL class.
Specialized class to report a message with explicit output level.
Definition: TBBMessageSvc.h:50
Specialized class to report a StatusCode message.
Definition: TBBMessageSvc.h:75
void run() override
Method to be implemented by the actual task classes.
Definition: TBBMessageSvc.h:54
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:406
StatusCodeMessage(TBBMessageSvc &svc, const StatusCode &sc, const std::string &source)
Definition: TBBMessageSvc.h:77
The Message class.
Definition: Message.h:17
int outputLevel() const override
Definition: MessageSvc.cpp:563
MessageWithLevel(TBBMessageSvc &svc, Message msg, int level)
Definition: TBBMessageSvc.h:52
MessageTaskCommon(TBBMessageSvc &svc)
Definition: TBBMessageSvc.h:42
Common base class for the different reportMessage cases.
Definition: TBBMessageSvc.h:40
Specialized class to report a message with implicit output level.
Definition: TBBMessageSvc.h:62