The Gaudi Framework
v30r3 (a5ef0a68)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ITimelineSvc.h
Go to the documentation of this file.
1
#ifndef GAUDIKERNEL_ITIMELINESVC_H
2
#define GAUDIKERNEL_ITIMELINESVC_H
3
4
#include "
GaudiKernel/IService.h
"
5
6
#include <pthread.h>
7
#include <string>
8
9
#include <chrono>
10
11
class
EventContext
;
12
13
struct
TimelineEvent
final {
14
using
Clock
=
std::chrono::high_resolution_clock
;
15
using
time_point
= Clock::time_point;
16
17
pthread_t
thread
;
18
size_t
slot
;
19
size_t
event
;
20
21
std::string
algorithm
;
22
23
time_point
start
;
24
time_point
end
;
25
};
26
27
class
GAUDI_API
ITimelineSvc
:
virtual
public
IService
28
{
29
30
public
:
32
DeclareInterfaceID
(
ITimelineSvc
, 2, 0 );
33
35
class
TimelineRecorder
final
36
{
37
public
:
38
using
Clock
=
TimelineEvent::Clock
;
39
40
TimelineRecorder
() =
default
;
41
TimelineRecorder
(
TimelineEvent
& record,
std::string
alg,
const
EventContext
& ctx );
42
43
TimelineRecorder
(
const
TimelineRecorder
& ) =
delete
;
44
TimelineRecorder
(
TimelineRecorder
&& other ) : m_record{other.m_record} { other.m_record =
nullptr
; }
45
46
TimelineRecorder
&
operator=
(
TimelineRecorder
&& other )
47
{
48
std::swap
( m_record, other.m_record );
49
return
*
this
;
50
}
51
52
~TimelineRecorder
()
53
{
54
if
( m_record ) m_record->end =
Clock::now
();
55
}
56
57
private
:
58
TimelineEvent
* m_record =
nullptr
;
59
};
60
61
virtual
TimelineRecorder
getRecorder(
std::string
alg,
const
EventContext
& ctx ) = 0;
62
// Augment a partially pre-filled TimelineEvent object with matching info
63
virtual
bool
getTimelineEvent(
TimelineEvent
& )
const
= 0;
64
virtual
bool
isEnabled()
const
= 0;
65
};
66
67
#endif
TimelineEvent::thread
pthread_t thread
Definition:
ITimelineSvc.h:17
std::swap
T swap(T...args)
TimelineEvent::algorithm
std::string algorithm
Definition:
ITimelineSvc.h:21
TimelineEvent
Definition:
ITimelineSvc.h:13
EventContext
This class represents an entry point to all the event specific data.
Definition:
EventContext.h:24
std::string
STL class.
TimelineEvent::Clock
std::chrono::high_resolution_clock Clock
Definition:
ITimelineSvc.h:14
TimelineEvent::end
time_point end
Definition:
ITimelineSvc.h:24
std::chrono::high_resolution_clock
TimelineEvent::time_point
Clock::time_point time_point
Definition:
ITimelineSvc.h:15
ITimelineSvc::TimelineRecorder::~TimelineRecorder
~TimelineRecorder()
Definition:
ITimelineSvc.h:52
IService
General service interface definition.
Definition:
IService.h:18
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition:
IInterface.h:13
ITimelineSvc::TimelineRecorder::TimelineRecorder
TimelineRecorder(TimelineRecorder &&other)
Definition:
ITimelineSvc.h:44
ITimelineSvc
Definition:
ITimelineSvc.h:27
IService.h
TimelineEvent::start
time_point start
Definition:
ITimelineSvc.h:23
ITimelineSvc::TimelineRecorder::operator=
TimelineRecorder & operator=(TimelineRecorder &&other)
Definition:
ITimelineSvc.h:46
std::chrono::high_resolution_clock::now
T now(T...args)
TimelineEvent::event
size_t event
Definition:
ITimelineSvc.h:19
ITimelineSvc::TimelineRecorder
RAII helper to record timeline events.
Definition:
ITimelineSvc.h:35
TimelineEvent::slot
size_t slot
Definition:
ITimelineSvc.h:18
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:104
GaudiKernel
GaudiKernel
ITimelineSvc.h
Generated on Wed Aug 1 2018 23:21:04 for The Gaudi Framework by
1.8.11