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

#include <src/PrecedenceRulesGraph.h>

Inheritance diagram for precedence::StartTime:
Collaboration diagram for precedence::StartTime:

Public Member Functions

 StartTime (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 282 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

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

Definition at line 283 of file PrecedenceRulesGraph.h.

283  : m_slot( slot )
284  {
285  SmartIF<IMessageSvc> msgSvc{svcLocator};
286  MsgStream log{msgSvc, "StartTime.Getter"};
287 
288  // Figure if we can discover the algorithm timings
289  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
290  if ( !m_timelineSvc.isValid() ) {
291  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
292  << "add algorithm start time to the TTT dumps" << endmsg;
293  }
294  }
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::StartTime::operator() ( const AlgoProps props) const
inline

Definition at line 296 of file PrecedenceRulesGraph.h.

297  {
298 
299  std::string startTime;
300 
301  if ( m_timelineSvc.isValid() ) {
302 
303  TimelineEvent te{};
304  te.algorithm = props.m_name;
305  te.slot = m_slot.eventContext->slot();
306  te.event = m_slot.eventContext->evt();
307 
309  startTime = std::to_string(
310  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
311  }
312 
313  return startTime;
314  }
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
SmartIF< ITimelineSvc > m_timelineSvc
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::StartTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 316 of file PrecedenceRulesGraph.h.

316 { return ""; }
std::string precedence::StartTime::operator() ( const DataProps ) const
inline

Definition at line 318 of file PrecedenceRulesGraph.h.

318 { return ""; }

Member Data Documentation

EventSlot precedence::StartTime::m_slot

Definition at line 320 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::StartTime::m_timelineSvc

Definition at line 321 of file PrecedenceRulesGraph.h.


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