The Gaudi Framework  v31r0 (aeb156f0)
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

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 250 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

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

Definition at line 251 of file PrecedenceRulesGraph.h.

251  : m_slot( slot ) {
252  SmartIF<IMessageSvc> msgSvc{svcLocator};
253  MsgStream log{msgSvc, "StartTime.Getter"};
254 
255  // Figure if we can discover the algorithm timings
256  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
257  if ( !m_timelineSvc.isValid() ) {
258  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
259  << "add algorithm start time to the TTT dumps" << endmsg;
260  }
261  }
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
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

Member Function Documentation

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

Definition at line 263 of file PrecedenceRulesGraph.h.

263  {
264 
265  std::string startTime;
266 
267  if ( m_timelineSvc.isValid() ) {
268 
269  TimelineEvent te{};
270  te.algorithm = props.m_name;
271  te.slot = m_slot.eventContext->slot();
272  te.event = m_slot.eventContext->evt();
273 
275  startTime = std::to_string(
276  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
277  }
278 
279  return startTime;
280  }
ContextID_t slot() const
Definition: EventContext.h:48
T to_string(T...args)
std::string algorithm
Definition: ITimelineSvc.h:21
ContextEvt_t evt() const
Definition: EventContext.h:47
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:62
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73
std::string precedence::StartTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 282 of file PrecedenceRulesGraph.h.

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

Definition at line 284 of file PrecedenceRulesGraph.h.

284 { return ""; }

Member Data Documentation

const EventSlot& precedence::StartTime::m_slot

Definition at line 286 of file PrecedenceRulesGraph.h.

SmartIF<ITimelineSvc> precedence::StartTime::m_timelineSvc

Definition at line 287 of file PrecedenceRulesGraph.h.


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