The Gaudi Framework  v30r3 (a5ef0a68)
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 348 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

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

Definition at line 349 of file PrecedenceRulesGraph.h.

349  : m_slot( slot )
350  {
351  SmartIF<IMessageSvc> msgSvc{svcLocator};
352  MsgStream log{msgSvc, "Duration.Getter"};
353 
354  // Figure if we can discover the algorithm timings
355  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
356  if ( !m_timelineSvc.isValid() )
357  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
358  << "algorithm's runtimes to the TTT dumps" << endmsg;
359  }
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 361 of file PrecedenceRulesGraph.h.

362  {
363 
365 
366  if ( m_timelineSvc.isValid() ) {
367 
368  TimelineEvent te;
369  te.algorithm = props.m_name;
370  te.slot = m_slot.eventContext->slot();
371  te.event = m_slot.eventContext->evt();
372 
374  time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
375  }
376 
377  return time;
378  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:44
T to_string(T...args)
std::string algorithm
Definition: ITimelineSvc.h:21
ContextEvt_t evt() const
Definition: EventContext.h:39
STL class.
time_point end
Definition: ITimelineSvc.h:24
SmartIF< ITimelineSvc > m_timelineSvc
time_point start
Definition: ITimelineSvc.h:23
virtual bool getTimelineEvent(TimelineEvent &) const =0
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 380 of file PrecedenceRulesGraph.h.

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

Definition at line 382 of file PrecedenceRulesGraph.h.

382 { return ""; }

Member Data Documentation

EventSlot precedence::Duration::m_slot

Definition at line 384 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 385 of file PrecedenceRulesGraph.h.


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