| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ChronoAuditor.cpp
Go to the documentation of this file.
1 // ChronoAuditor:
2 // An auditor that monitors time
3
4 #ifdef __ICC
5 // disable icc warning #654: overloaded virtual function "B::Y" is only partially overridden in class "C"
6 // TODO: there is only a partial overload of IAuditor::before and IAuditor::after
7 #pragma warning(disable:654)
8 #endif
9
10 #include "ChronoAuditor.h"
11
12 DECLARE_COMPONENT(ChronoAuditor)
13
14 ChronoAuditor::ChronoAuditor(const std::string& name, ISvcLocator* pSvcLocator)
15 : CommonAuditor(name, pSvcLocator) {
16 }
17
18 ChronoAuditor::~ChronoAuditor() {}
19
20 StatusCode ChronoAuditor::initialize() {
21 StatusCode sc = CommonAuditor::initialize();
22 if (UNLIKELY(sc.isFailure())) return sc;
23
24 m_chronoSvc = serviceLocator()->service("ChronoStatSvc");
25 if (UNLIKELY(!m_chronoSvc.get())) {
26 MsgStream log(msgSvc(), name());
27 log << MSG::ERROR << "Cannot get ChronoStatSvc" << endmsg;
28 return StatusCode::FAILURE;
29 }
30 return StatusCode::SUCCESS;
31 }
32
33 void ChronoAuditor::i_before(CustomEventTypeRef evt, const std::string& caller)
34 {
35 chronoSvc()->chronoStart(i_id(evt, caller));
36 }
37
38 void ChronoAuditor::i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&)
39 {
40 chronoSvc()->chronoStop(i_id(evt, caller));
41 }