| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
precedence::StartTime Struct Reference

`#include <src/PRGraph/PrecedenceRulesGraph.h>`

Collaboration diagram for precedence::StartTime:
[legend]

## 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 EventSlot & | m_slot
SmartIF< ITimelineSvc > | m_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 ) {
251 SmartIF<IMessageSvc> msgSvc{svcLocator};
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 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc >
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:67
precedence::StartTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:286
ISvcLocator::service
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::svcLocator
GAUDI_API ISvcLocator * svcLocator()
ITimelineSvc
Definition: ITimelineSvc.h:27
MSG::WARNING
Definition: IMessageSvc.h:15
precedence::StartTime::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:285
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## 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
273 m_timelineSvc->getTimelineEvent( te );
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 }
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
std::to_string
T to_string(T... args)
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
ITimelineSvc::getTimelineEvent
virtual bool getTimelineEvent(TimelineEvent &) const =0
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:21
TimelineEvent
Definition: ITimelineSvc.h:13
precedence::StartTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:286
std::string
STL class.
std::count
T count(T... args)
precedence::StartTime::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:285
EventSlot::eventContext
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:

- GaudiHive/src/PRGraph/PrecedenceRulesGraph.h