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

Constructor & Destructor Documentation

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

Definition at line 308 of file PrecedenceRulesGraph.h.

308  : m_slot( slot )
309  {
310  SmartIF<IMessageSvc> msgSvc{svcLocator};
311  MsgStream log{msgSvc, "EndTime.Getter"};
312 
313  // Figure if we can discover the algorithm timings
314  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
315  if ( !m_timelineSvc.isValid() )
316  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
317  << "algorithm completion time to the TTT dumps" << endmsg;
318  }
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 320 of file PrecedenceRulesGraph.h.

321  {
322 
323  std::string endTime;
324 
325  if ( m_timelineSvc.isValid() ) {
326 
327  TimelineEvent te{};
328  te.algorithm = props.m_name;
329  te.slot = m_slot.eventContext->slot();
330  te.event = m_slot.eventContext->evt();
331 
333  endTime =
334  std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
335  }
336 
337  return endTime;
338  }
ContextID_t slot() const
Definition: EventContext.h:40
EventContext * eventContext
Cache for the eventContext.
Definition: EventSlot.h:44
T to_string(T...args)
SmartIF< ITimelineSvc > m_timelineSvc
std::string algorithm
Definition: ITimelineSvc.h:21
ContextEvt_t evt() const
Definition: EventContext.h:39
STL class.
T count(T...args)
virtual bool getTimelineEvent(TimelineEvent &) const =0
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 340 of file PrecedenceRulesGraph.h.

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

Definition at line 342 of file PrecedenceRulesGraph.h.

342 { return ""; }

Member Data Documentation

EventSlot precedence::EndTime::m_slot

Definition at line 344 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 345 of file PrecedenceRulesGraph.h.


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