BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
MessageSvcProvider Class Reference

Class that provides message services. Add to any classes that need message services. More...

#include <MessageSvcProvider.h>

Public Member Functions

 ~MessageSvcProvider ()
 
IMessageSvc * msgSvc ()
 

Static Public Member Functions

static MessageSvcProviderinstance ()
 

Detailed Description

Class that provides message services. Add to any classes that need message services.

Warning
THIS CLASS IS NOT THREAD-SAFE!

Definition at line 17 of file MessageSvcProvider.h.

Constructor & Destructor Documentation

◆ ~MessageSvcProvider()

MessageSvcProvider::~MessageSvcProvider ( )
inline

Definition at line 22 of file MessageSvcProvider.h.

22{}

Member Function Documentation

◆ instance()

MessageSvcProvider * MessageSvcProvider::instance ( )
static

Definition at line 5 of file MessageSvcProvider.cxx.

5 {
6 if (s_instancePointer == NULL) {
7 s_instancePointer = new MessageSvcProvider;
8 }
9 return s_instancePointer;
10}
Class that provides message services. Add to any classes that need message services.

Referenced by HltProcessor::MyFrame::MyFrame(), HltProcessor::Sequence::Sequence(), and HltProcessor::Signature::Signature().

◆ msgSvc()

IMessageSvc * MessageSvcProvider::msgSvc ( )
inline
Warning
If this fails, without cout there is no way to tell the user!
Returns
An IMessageSvc pointer. To use, your class needs a MessageSvcProvider as a member. You can then do: MsgStream log(m_MessageSvcProvider.msgSvc(), m_objectName);

Definition at line 30 of file MessageSvcProvider.h.

30 {
31// if(!m_pMsgSvc){
32 ISvcLocator* serviceLocator = Gaudi::svcLocator();
33 //IService* theSvc;
34 //std::cout<<"!!!!!!!!!!!!!!!!!1"<<std::endl;
35 StatusCode sc = serviceLocator->service("MessageSvc",m_pMsgSvc);
36 if(sc.isFailure()) exit(1); // Service [MessageSvc] not found
37 //std::cout<<"!!!!!!!!!!!!!!!!!2"<<std::endl;
38 //m_pMsgSvc = dynamic_cast<IMessageSvc*>(theSvc);
39 if(!m_pMsgSvc) exit(1); // Dynamic cast IService --> IMessageSvc failed
40// }
41 //std::cout<<"!!!!!!!!!!!!!!!!!3"<<std::endl;
42 return m_pMsgSvc;
43 }

Referenced by HltProcessor::Sequence::print(), and HltProcessor::Signature::print().


The documentation for this class was generated from the following files: