artdaq_mfextensions
v1_05_00
Return to top level
Main Page
Namespaces
Classes
Files
File List
File Members
ma_timing_event.h
1
#ifndef ERROR_HANDLER_MA_TIMING_EVENT_H
2
#define ERROR_HANDLER_MA_TIMING_EVENT_H
3
4
#include "ErrorHandler/MessageAnalyzer/ma_types.h"
5
#include <boost/thread/mutex.hpp>
6
#include <queue>
7
8
namespace
novadaq {
9
namespace
errorhandler {
10
11
class
ma_condition;
12
13
class
ma_timing_event
14
{
15
public
:
16
ma_timing_event
(time_t t,
ma_condition
& c,
size_t
src,
size_t
tgt)
17
: ts(t), cond(&c), s_idx(src), t_idx(tgt) { }
18
19
time_t timestamp()
const
{
return
ts; }
20
ma_condition
& condition()
const
{
return
*cond; }
21
size_t
source_idx()
const
{
return
s_idx; }
22
size_t
target_idx()
const
{
return
t_idx; }
23
24
private
:
25
time_t ts;
26
ma_condition
* cond;
27
size_t
s_idx;
28
size_t
t_idx;
29
};
30
31
struct
ma_timing_event_order
32
{
33
bool
operator()(
ma_timing_event
const
& e1,
ma_timing_event
const
& e2)
const
34
{
return
e1.timestamp() > e2.timestamp(); }
35
};
36
37
typedef
std::priority_queue<
ma_timing_event
38
, std::vector<ma_timing_event>
39
,
ma_timing_event_order
> event_queue_t;
40
41
class
ma_timing_events
42
{
43
public
:
44
ma_timing_events
()
45
: queue(), lock() { }
46
47
event_queue_t
const
& event_queue()
const
{
return
queue; }
48
event_queue_t & event_queue() {
return
queue; }
49
50
private
:
51
event_queue_t queue;
52
53
public
:
54
boost::mutex lock;
55
};
56
57
58
}
59
}
60
61
#endif
novadaq::errorhandler::ma_timing_event_order
Definition:
ma_timing_event.h:31
novadaq::errorhandler::ma_condition
Definition:
ma_condition.h:27
novadaq::errorhandler::ma_timing_event
Definition:
ma_timing_event.h:13
novadaq::errorhandler::ma_timing_events
Definition:
ma_timing_event.h:41
src
ErrorHandler
MessageAnalyzer
ma_timing_event.h
Generated on Mon Jul 27 2020 10:18:49 for artdaq_mfextensions by
1.8.5