The Gaudi Framework  v31r0 (aeb156f0)
precedence::EndTime Struct Reference

#include <src/PrecedenceRulesGraph.h>

Inheritance diagram for precedence::EndTime:
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 290 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

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

Definition at line 291 of file PrecedenceRulesGraph.h.

291  : m_slot( slot ) {
292  SmartIF<IMessageSvc> msgSvc{svcLocator};
293  MsgStream log{msgSvc, "EndTime.Getter"};
294 
295  // Figure if we can discover the algorithm timings
296  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
297  if ( !m_timelineSvc.isValid() )
298  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
299  << "algorithm completion time to the TTT dumps" << endmsg;
300  }
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:76
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
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

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

Definition at line 302 of file PrecedenceRulesGraph.h.

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

Definition at line 321 of file PrecedenceRulesGraph.h.

321 { return ""; }
std::string precedence::EndTime::operator() ( const DataProps ) const
inline

Definition at line 323 of file PrecedenceRulesGraph.h.

323 { return ""; }

Member Data Documentation

const EventSlot& precedence::EndTime::m_slot

Definition at line 325 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 326 of file PrecedenceRulesGraph.h.


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