Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v31r0 (aeb156f0)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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
public
:
31
DeclareInterfaceID
(
ITimelineSvc
, 2, 0 );
32
34
class
TimelineRecorder
final {
35
public
:
36
using
Clock
=
TimelineEvent::Clock
;
37
38
TimelineRecorder
() =
default
;
39
TimelineRecorder
(
TimelineEvent
& record,
std::string
alg,
const
EventContext
& ctx );
40
41
TimelineRecorder
(
const
TimelineRecorder
& ) =
delete
;
42
TimelineRecorder
(
TimelineRecorder
&& other ) : m_record{other.m_record} { other.m_record =
nullptr
; }
43
44
TimelineRecorder
&
operator=
(
TimelineRecorder
&& other ) {
45
std::swap
( m_record, other.m_record );
46
return
*
this
;
47
}
48
49
~TimelineRecorder
() {
50
if
( m_record ) m_record->end =
Clock::now
();
51
}
52
53
private
:
54
TimelineEvent
* m_record =
nullptr
;
55
};
56
57
virtual
TimelineRecorder
getRecorder(
std::string
alg,
const
EventContext
& ctx ) = 0;
58
// Augment a partially pre-filled TimelineEvent object with matching info
59
virtual
bool
getTimelineEvent(
TimelineEvent
& )
const
= 0;
60
virtual
bool
isEnabled()
const
= 0;
61
};
62
63
#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:31
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:49
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:42
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:44
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:34
TimelineEvent::slot
size_t slot
Definition:
ITimelineSvc.h:18
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:71
GaudiKernel
GaudiKernel
ITimelineSvc.h
Generated on Mon Feb 11 2019 17:48:15 for The Gaudi Framework by
1.8.11