|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
00001 // $Id: RootPerfMonSvc.cpp,v 1.12 2010-09-27 15:43:53 frankb Exp $ 00002 //==================================================================== 00003 // RootPerfMonSvc implementation 00004 //-------------------------------------------------------------------- 00005 // 00006 // Description: Implementation of the ROOT data storage 00007 // 00008 // Author : M.Frank 00009 // 00010 //==================================================================== 00011 00012 // Framework include files 00013 #include "GaudiKernel/MsgStream.h" 00014 #include "GaudiKernel/IIncidentSvc.h" 00015 #include "GaudiKernel/DataIncident.h" 00016 #include "GaudiKernel/Incident.h" 00017 #include "GaudiKernel/System.h" 00018 #include "RootCnv/RootPerfMonSvc.h" 00019 #include "RootUtils.h" 00020 00021 using namespace std; 00022 using namespace Gaudi; 00023 typedef const string& CSTR; 00024 00025 #define S_OK StatusCode::SUCCESS 00026 #define S_FAIL StatusCode::FAILURE 00027 00028 // Standard constructor 00029 RootPerfMonSvc::RootPerfMonSvc(CSTR nam, ISvcLocator* svc) 00030 : Service( nam, svc), m_incidentSvc(0) 00031 { 00032 declareProperty("IOPerfStats", m_ioPerfStats); 00033 } 00034 00035 // Standard destructor 00036 RootPerfMonSvc::~RootPerfMonSvc() { 00037 } 00038 00039 // Small routine to issue exceptions 00040 StatusCode RootPerfMonSvc::error(CSTR msg) { 00041 if ( m_log ) { 00042 log() << MSG::ERROR << "Error: " << msg << endmsg; 00043 return S_FAIL; 00044 } 00045 MsgStream m(msgSvc(),name()); 00046 m << MSG::ERROR << "Error: " << msg << endmsg; 00047 return S_FAIL; 00048 } 00049 00050 // Initialize the Db data persistency service 00051 StatusCode RootPerfMonSvc::initialize() { 00052 string cname; 00053 StatusCode status = Service::initialize(); 00054 if ( !status.isSuccess() ) 00055 return error("Failed to initialize Service base class."); 00056 m_log = new MsgStream(msgSvc(),name()); 00057 if( !(status=service("IncidentSvc", m_incidentSvc)).isSuccess() ) 00058 return error("Unable to localize interface from service:IncidentSvc"); 00059 return S_OK; 00060 } 00061 00062 // Finalize the Db data persistency service 00063 StatusCode RootPerfMonSvc::finalize() { 00064 log() << MSG::INFO; 00065 deletePtr(m_log); 00066 releasePtr(m_incidentSvc); 00067 return Service::finalize(); 00068 }