The Gaudi Framework  v33r0 (d5ea422b)
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 299 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ EndTime()

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

Definition at line 300 of file PrecedenceRulesGraph.h.

300  : m_slot( slot ) {
302  MsgStream log{msgSvc, "EndTime.Getter"};
303 
304  // Figure if we can discover the algorithm timings
305  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
306  if ( !m_timelineSvc.isValid() )
307  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
308  << "algorithm completion time to the TTT dumps" << endmsg;
309  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
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:86
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:202

Member Function Documentation

◆ operator()() [1/3]

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

Definition at line 311 of file PrecedenceRulesGraph.h.

311  {
312 
313  std::string endTime;
314 
315  if ( m_timelineSvc.isValid() ) {
316 
317  TimelineEvent te{};
318  te.algorithm = props.m_name;
319  te.slot = m_slot.eventContext->slot();
320  te.event = m_slot.eventContext->evt();
321 
323  endTime =
324  std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
325  }
326 
327  return endTime;
328  }
ContextID_t slot() const
Definition: EventContext.h:51
ContextEvt_t evt() const
Definition: EventContext.h:50
T to_string(T... args)
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
virtual bool getTimelineEvent(TimelineEvent &) const =0
SmartIF< ITimelineSvc > m_timelineSvc
std::string algorithm
Definition: ITimelineSvc.h:31
STL class.
T count(T... args)
const EventSlot & m_slot
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83

◆ operator()() [2/3]

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

Definition at line 330 of file PrecedenceRulesGraph.h.

330 { return ""; }

◆ operator()() [3/3]

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

Definition at line 332 of file PrecedenceRulesGraph.h.

332 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::EndTime::m_slot

Definition at line 334 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 335 of file PrecedenceRulesGraph.h.


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