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

#include <src/PRGraph/PrecedenceRulesGraph.h>

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

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 289 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ EndTime()

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

Definition at line 290 of file PrecedenceRulesGraph.h.

290  : m_slot( slot ) {
292  MsgStream log{msgSvc, "EndTime.Getter"};
293 
294  // Figure if we can discover the algorithm timings
295  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
296  if ( !m_timelineSvc.isValid() )
297  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
298  << "algorithm completion time to the TTT dumps" << endmsg;
299  }
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()
const EventSlot & m_slot
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::EndTime::operator() ( const AlgoProps props) const
inline

Definition at line 301 of file PrecedenceRulesGraph.h.

301  {
302 
303  std::string endTime;
304 
305  if ( m_timelineSvc.isValid() ) {
306 
307  TimelineEvent te{};
308  te.algorithm = props.m_name;
309  te.slot = m_slot.eventContext->slot();
310  te.event = m_slot.eventContext->evt();
311 
313  endTime =
314  std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
315  }
316 
317  return endTime;
318  }
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
SmartIF< ITimelineSvc > m_timelineSvc
std::string algorithm
Definition: ITimelineSvc.h:21
STL class.
T count(T... args)
const EventSlot & m_slot
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73

◆ operator()() [2/3]

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

Definition at line 320 of file PrecedenceRulesGraph.h.

320 { return ""; }

◆ operator()() [3/3]

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

Definition at line 322 of file PrecedenceRulesGraph.h.

322 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::EndTime::m_slot

Definition at line 324 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 325 of file PrecedenceRulesGraph.h.


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