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

#include <src/PrecedenceRulesGraph.h>

Inheritance diagram for precedence::EndTime:
Collaboration diagram for precedence::EndTime:

Public Member Functions

 EndTime (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 324 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

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

Definition at line 325 of file PrecedenceRulesGraph.h.

325  : m_slot( slot )
326  {
327  SmartIF<IMessageSvc> msgSvc{svcLocator};
328  MsgStream log{msgSvc, "EndTime.Getter"};
329 
330  // Figure if we can discover the algorithm timings
331  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
332  if ( !m_timelineSvc.isValid() )
333  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
334  << "algorithm completion time to the TTT dumps" << endmsg;
335  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< ITimelineSvc > m_timelineSvc
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
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::EndTime::operator() ( const AlgoProps props) const
inline

Definition at line 337 of file PrecedenceRulesGraph.h.

338  {
339 
340  std::string endTime;
341 
342  if ( m_timelineSvc.isValid() ) {
343 
344  TimelineEvent te{};
345  te.algorithm = props.m_name;
346  te.slot = m_slot.eventContext->slot();
347  te.event = m_slot.eventContext->evt();
348 
350  endTime =
351  std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
352  }
353 
354  return endTime;
355  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:28
T to_string(T...args)
SmartIF< ITimelineSvc > m_timelineSvc
std::string algorithm
Definition: ITimelineSvc.h:18
ContextEvt_t evt() const
Definition: EventContext.h:39
STL class.
virtual void getTimelineEvent(TimelineEvent &) const =0
T count(T...args)
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:68
std::string precedence::EndTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 357 of file PrecedenceRulesGraph.h.

357 { return ""; }
std::string precedence::EndTime::operator() ( const DataProps ) const
inline

Definition at line 359 of file PrecedenceRulesGraph.h.

359 { return ""; }

Member Data Documentation

EventSlot precedence::EndTime::m_slot

Definition at line 361 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 362 of file PrecedenceRulesGraph.h.


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