#include <BesTimerSvc.h>
Inheritance diagram for BesTimerSvc:
Public Member Functions | |
virtual BesTimer * | addItem (const std::string &name) |
virtual BesTimer * | addItem (const std::string &name) |
virtual std::vector< BesTimer * >::iterator | begin (void) |
virtual std::vector< BesTimer * >::iterator | begin (void) |
BesTimerSvc (const std::string &name, ISvcLocator *svcloc) | |
BesTimerSvc (const std::string &name, ISvcLocator *svcloc) | |
virtual std::vector< BesTimer * >::iterator | end (void) |
virtual std::vector< BesTimer * >::iterator | end (void) |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
virtual void | print () |
virtual void | print () |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
~BesTimerSvc () | |
~BesTimerSvc () | |
Static Public Member Functions | |
const InterfaceID & | interfaceID () |
const InterfaceID & | interfaceID () |
Private Attributes | |
std::vector< BesTimer * > | m_itemList |
std::vector< BesTimer * > | m_itemList |
|
00016 : Service(name, svcloc) {}
|
|
00018 { 00019 std::vector < BesTimer* >::iterator it = m_itemList.begin(); 00020 for (; it != m_itemList.end(); it++) { 00021 delete (*it); 00022 } 00023 }
|
|
|
|
|
|
Implements IBesTimerSvc. |
|
Implements IBesTimerSvc. 00056 { 00057 00058 // Create a BesTimer and return a pointer to it 00059 // If an item of that name already exists, flag error 00060 // by returning NULL 00061 00062 MsgStream log(messageService(), name()); 00063 log << MSG::DEBUG << name() << " adding " << itemName << endreq; 00064 00065 BesTimer* item = new BesTimer(itemName); 00066 m_itemList.push_back(item); 00067 return item; 00068 }
|
|
Implements IBesTimerSvc. |
|
Implements IBesTimerSvc. 00114 { 00115 return m_itemList.begin(); 00116 }
|
|
Implements IBesTimerSvc. |
|
Implements IBesTimerSvc. 00117 { 00118 return m_itemList.end(); 00119 }
|
|
|
|
00047 { 00048 MsgStream log(messageService(), name()); 00049 log << MSG::INFO << name() << ": End of Run Statistics" << endreq; 00050 this->print(); 00051 return StatusCode::SUCCESS; 00052 }
|
|
|
|
00034 { 00035 MsgStream log(messageService(), name()); 00036 log << MSG::INFO << name() << ": Start of run initialisation" << endreq; 00037 00038 StatusCode sc = Service::initialize(); 00039 if ( sc.isFailure() ) return sc; 00040 // Set my own properties 00041 setProperties(); 00042 00043 return StatusCode::SUCCESS; 00044 }
|
|
00020 { return IID_IBesTimerSvc; }
|
|
00020 { return IID_IBesTimerSvc; }
|
|
Implements IBesTimerSvc. |
|
Implements IBesTimerSvc. 00070 { 00071 MsgStream log(messageService(), name()); 00072 00073 log << MSG::INFO << "==============================BesTimerSvc::Print===============================" << endreq; 00074 unsigned int maxname=0; 00075 std::vector < BesTimer* >::iterator it = m_itemList.begin(); 00076 for (; it != m_itemList.end(); it++) { 00077 if ((*it)->name().length() > maxname) maxname = static_cast<int>((*it)->name().length()); 00078 if (!(*it)->propName().empty()) { 00079 if ((*it)->propName().length() > maxname) maxname = static_cast<int>((*it)->propName().length()); 00080 } 00081 } 00082 00083 it = m_itemList.begin(); 00084 for (; it != m_itemList.end(); it++) { 00085 std::string nam = (*it)->name(); 00086 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," "); 00087 log << MSG::INFO << nam << " mean(t) : " << std::setw(12) << (*it)->mean()<< 00088 " ms rms : " << std::setw(12) << (*it)->rms() << " ms " << endreq; 00089 } 00090 log << MSG::INFO << "------------------------------------------------------------------------------" << endreq; 00091 it = m_itemList.begin(); 00092 for (; it != m_itemList.end(); it++) { 00093 if (!(*it)->propName().empty()) { 00094 std::string nam = (*it)->name(); 00095 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," "); 00096 log << MSG::INFO << nam << " mean(t) : " << std::setw(12) << (*it)->mean()<< 00097 " ms rms : " << std::setw(12) << (*it)->rms() << " ms " << endreq; 00098 00099 nam = (*it)->propName(); 00100 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," "); 00101 if ((*it)->meanPropVal() == 0) { 00102 log << MSG::INFO << nam << " mean(N) : " << std::setw(12) << endreq; 00103 } else { 00104 log << MSG::INFO << nam << " mean(N) : " << std::setw(12) << (*it)->meanPropVal() << 00105 " mean(t/N) : " 00106 << 1000.*(*it)->meanTimePerObject() << " us " << endreq; 00107 } 00108 } 00109 } 00110 00111 log << MSG::INFO << "==============================BesTimerSvc::Print===============================" << endreq; 00112 }
|
|
|
|
00025 { 00026 00027 if ( IID_IBesTimerSvc.versionMatch(riid) ) { 00028 *ppvInterface = static_cast<IBesTimerSvc*> (this); 00029 } else { 00030 return Service::queryInterface(riid, ppvInterface) ; 00031 } 00032 return StatusCode::SUCCESS; 00033 }
|
|
|
|
|