The Gaudi Framework  v32r2 (46d42edc)
precedence::StartTime Struct Reference

#include <src/PRGraph/PrecedenceRulesGraph.h>

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

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 249 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ StartTime()

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

Definition at line 250 of file PrecedenceRulesGraph.h.

250  : m_slot( slot ) {
252  MsgStream log{msgSvc, "StartTime.Getter"};
253 
254  // Figure if we can discover the algorithm timings
255  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
256  if ( !m_timelineSvc.isValid() ) {
257  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
258  << "add algorithm start time to the TTT dumps" << endmsg;
259  }
260  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
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:76
GAUDI_API ISvcLocator * svcLocator()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

Member Function Documentation

◆ operator()() [1/3]

std::string precedence::StartTime::operator() ( const AlgoProps props) const
inline

Definition at line 262 of file PrecedenceRulesGraph.h.

262  {
263 
264  std::string startTime;
265 
266  if ( m_timelineSvc.isValid() ) {
267 
268  TimelineEvent te{};
269  te.algorithm = props.m_name;
270  te.slot = m_slot.eventContext->slot();
271  te.event = m_slot.eventContext->evt();
272 
274  startTime = std::to_string(
275  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
276  }
277 
278  return startTime;
279  }
ContextID_t slot() const
Definition: EventContext.h:41
ContextEvt_t evt() const
Definition: EventContext.h:40
T to_string(T... args)
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
virtual bool getTimelineEvent(TimelineEvent &) const =0
std::string algorithm
Definition: ITimelineSvc.h:21
SmartIF< ITimelineSvc > m_timelineSvc
STL class.
T count(T... args)
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73

◆ operator()() [2/3]

std::string precedence::StartTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 281 of file PrecedenceRulesGraph.h.

281 { return ""; }

◆ operator()() [3/3]

std::string precedence::StartTime::operator() ( const DataProps ) const
inline

Definition at line 283 of file PrecedenceRulesGraph.h.

283 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::StartTime::m_slot

Definition at line 285 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::StartTime::m_timelineSvc

Definition at line 286 of file PrecedenceRulesGraph.h.


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