17 #pragma warning(disable:654)
111 error() <<
"Could not retrieve 'ToolSvc' " <<
endmsg ;
116 sc = m_toolSvc->retrieveTool
117 (
"SequencerTimerTool/TIMER" , m_timer ,
this ,
true ) ;
120 error() <<
"Could not retrieve ISequencerTimerTool" <<
endmsg ;
131 error() <<
"Could not retrieve 'IncidentSvc'" <<
endmsg ;
134 m_incSvc -> addListener (
this , IncidentType::BeginEvent ) ;
135 m_incSvc -> addListener (
this , IncidentType::EndEvent ) ;
143 error() <<
"Could not retrieve 'ApplicationMgr'" <<
endmsg ;
146 if ( m_map.end() == m_map.find( m_appMgr.get() ) )
148 m_map.insert ( m_appMgr.get() , m_timer->addTimer(
"EVENT LOOP" ) ) ;
159 m_incSvc -> removeListener (
this , IncidentType::BeginEvent ) ;
160 m_incSvc -> removeListener (
this , IncidentType::EndEvent ) ;
212 if ( !alg ) { return ; }
214 if (
m_map.
end() != found ) { return ; }
221 debug() <<
"Insert non-structural component '"
222 << alg->
name() <<
"' of type '"
239 if ( !alg ) { return ; }
244 debug() <<
"Insert non-structural component '"
245 << alg->
name() <<
"' of type '"
261 if ( !alg ) { return ; }
263 if (
m_map.
end() == found ) { return ; }
271 if ( name.
empty() && evt.empty() ) {
return; }
283 timer = found->second;
291 if ( name.
empty() && evt.empty() ) {
return; }
299 warning() <<
"Trying to stop the measure of the timing for '"
300 << nick <<
"' but it was never started. Check the code"
309 if ( IncidentType::BeginEvent == i.
type () ) {
313 }
else if ( IncidentType::EndEvent == i.
type () ) {
void i_afterInitialize(INamedInterface *alg)
void i_beforeInitialize(INamedInterface *alg)
TimingAuditor & operator=(const TimingAuditor &)=delete
virtual StatusCode finalize()
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn't already exist.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & type() const
Access to the incident type.
TimingAuditor(const std::string &name, ISvcLocator *pSvc)
standard constructor
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
bool m_inEvent
"In event" flag
StatusCode finalize() override
void i_beforeExecute(INamedInterface *alg)
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
void after(StandardEventType evt, INamedInterface *alg, const StatusCode &sc) override
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
virtual const std::string & name() const =0
Retrieve the name of the instance.
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
StatusCode initialize() override
factory:
iterator find(const key_type &key) const
find the element by key
TYPE * get() const
Get interface pointer.
int m_indent
indentation level
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
iterator end() const
"end" iterator for sequential access (const-only version!)
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
SmartIF< IIncidentSvc > m_incSvc
incident service
void before(StandardEventType evt, INamedInterface *alg) override
iterator find(const key_type &key)
void after(StandardEventType, INamedInterface *, const StatusCode &) override
~TimingAuditor() override=default
destructor
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
void i_beforeFinalize(INamedInterface *alg)
IInterface compliant class extending IInterface with the name() method.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Base class used to extend a class implementing other interfaces.
Base class for all Incidents (computing events).
const std::string & name() const override
void clear()
clear the container
SmartIF< IToolSvc > m_toolSvc
tool service
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
ISequencerTimerTool * m_timer
the timer tool
virtual StatusCode initialize()
bool m_goodForDOD
"optimized for DOD"
void handle(const Incident &) override
Inform that a new incident has occurred.
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void i_afterExecute(INamedInterface *alg)
Simple auditor which uses SequencerTimerTool for ALL algorithms, including the algorithm from main Ga...