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

Constructor & Destructor Documentation

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

Definition at line 266 of file PrecedenceRulesGraph.h.

266  : m_slot( slot )
267  {
268  SmartIF<IMessageSvc> msgSvc{svcLocator};
269  MsgStream log{msgSvc, "StartTime.Getter"};
270 
271  // Figure if we can discover the algorithm timings
272  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
273  if ( !m_timelineSvc.isValid() ) {
274  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
275  << "add algorithm start time to the TTT dumps" << endmsg;
276  }
277  }
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 279 of file PrecedenceRulesGraph.h.

280  {
281 
282  std::string startTime;
283 
284  if ( m_timelineSvc.isValid() ) {
285 
286  TimelineEvent te{};
287  te.algorithm = props.m_name;
288  te.slot = m_slot.eventContext->slot();
289  te.event = m_slot.eventContext->evt();
290 
292  startTime = std::to_string(
293  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
294  }
295 
296  return startTime;
297  }
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
SmartIF< ITimelineSvc > m_timelineSvc
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::StartTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 299 of file PrecedenceRulesGraph.h.

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

Definition at line 301 of file PrecedenceRulesGraph.h.

301 { return ""; }

Member Data Documentation

EventSlot precedence::StartTime::m_slot

Definition at line 303 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::StartTime::m_timelineSvc

Definition at line 304 of file PrecedenceRulesGraph.h.


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