The Gaudi Framework  master (a6dcad88)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ITimelineSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_ITIMELINESVC_H
12 #define GAUDIKERNEL_ITIMELINESVC_H
13 
14 #include <GaudiKernel/IService.h>
15 
16 #include <string>
17 
18 class EventContext;
19 struct TimelineEvent;
20 
21 class GAUDI_API ITimelineSvc : virtual public IService {
22 
23 public:
26 
28  class TimelineRecorder final {
29  public:
30  TimelineRecorder() = default;
31  TimelineRecorder( TimelineEvent& record, std::string alg, const EventContext& ctx );
32 
33  TimelineRecorder( const TimelineRecorder& ) = delete;
35  TimelineRecorder( TimelineRecorder&& other ) : m_record{ std::exchange( other.m_record, nullptr ) } {}
36 
38  m_record = std::exchange( other.m_record, nullptr );
39  return *this;
40  }
41 
43 
44  private:
45  TimelineEvent* m_record = nullptr;
46  };
47 
48  virtual TimelineRecorder getRecorder( std::string alg, const EventContext& ctx ) = 0;
49  // Augment a partially pre-filled TimelineEvent object with matching info
50  virtual bool getTimelineEvent( TimelineEvent& ) const = 0;
51  virtual bool isEnabled() const = 0;
52 };
53 
54 #endif
IService
Definition: IService.h:28
ITimelineSvc::getTimelineEvent
virtual bool getTimelineEvent(TimelineEvent &) const =0
ITimelineSvc::TimelineRecorder::TimelineRecorder
TimelineRecorder(TimelineRecorder &&other)
Definition: ITimelineSvc.h:35
IService.h
ITimelineSvc::isEnabled
virtual bool isEnabled() const =0
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
TimelineEvent
Definition: TimelineEvent.h:16
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
ITimelineSvc
Definition: ITimelineSvc.h:21
ITimelineSvc::DeclareInterfaceID
DeclareInterfaceID(ITimelineSvc, 2, 0)
InterfaceID.
ITimelineSvc::TimelineRecorder
RAII helper to record timeline events.
Definition: ITimelineSvc.h:28
ITimelineSvc::getRecorder
virtual TimelineRecorder getRecorder(std::string alg, const EventContext &ctx)=0
ITimelineSvc::TimelineRecorder::TimelineRecorder
TimelineRecorder(const TimelineRecorder &)=delete
ITimelineSvc::TimelineRecorder::TimelineRecorder
TimelineRecorder()=default
ITimelineSvc::TimelineRecorder::operator=
TimelineRecorder & operator=(TimelineRecorder &&other)
Definition: ITimelineSvc.h:37
EventContext
Definition: EventContext.h:34
ITimelineSvc::TimelineRecorder::operator=
TimelineRecorder & operator=(const TimelineRecorder &)=delete
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81