The Gaudi Framework  v30r0 (c919700c)
precedence::Duration Struct Reference

#include <src/PrecedenceRulesGraph.h>

Inheritance diagram for precedence::Duration:
Collaboration diagram for precedence::Duration:

Public Member Functions

 Duration (const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
 
std::string operator() (const AlgoProps &props) const
 
std::string operator() (const DecisionHubProps &) const
 
std::string operator() (const DataProps &) const
 

Public Attributes

EventSlot m_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 365 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

precedence::Duration::Duration ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator 
)
inline

Definition at line 366 of file PrecedenceRulesGraph.h.

366  : m_slot( slot )
367  {
368  SmartIF<IMessageSvc> msgSvc{svcLocator};
369  MsgStream log{msgSvc, "Duration.Getter"};
370 
371  // Figure if we can discover the algorithm timings
372  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
373  if ( !m_timelineSvc.isValid() )
374  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
375  << "algorithm's runtimes to the TTT dumps" << endmsg;
376  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
SmartIF< ITimelineSvc > m_timelineSvc
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

Member Function Documentation

std::string precedence::Duration::operator() ( const AlgoProps props) const
inline

Definition at line 378 of file PrecedenceRulesGraph.h.

379  {
380 
382 
383  if ( m_timelineSvc.isValid() ) {
384 
385  TimelineEvent te;
386  te.algorithm = props.m_name;
387  te.slot = m_slot.eventContext->slot();
388  te.event = m_slot.eventContext->evt();
389 
391  time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
392  }
393 
394  return time;
395  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:28
T to_string(T...args)
std::string algorithm
Definition: ITimelineSvc.h:18
ContextEvt_t evt() const
Definition: EventContext.h:39
STL class.
virtual void getTimelineEvent(TimelineEvent &) const =0
time_point end
Definition: ITimelineSvc.h:21
SmartIF< ITimelineSvc > m_timelineSvc
time_point start
Definition: ITimelineSvc.h:20
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
std::string precedence::Duration::operator() ( const DecisionHubProps ) const
inline

Definition at line 397 of file PrecedenceRulesGraph.h.

397 { return ""; }
std::string precedence::Duration::operator() ( const DataProps ) const
inline

Definition at line 399 of file PrecedenceRulesGraph.h.

399 { return ""; }

Member Data Documentation

EventSlot precedence::Duration::m_slot

Definition at line 401 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 402 of file PrecedenceRulesGraph.h.


The documentation for this struct was generated from the following file: