artdaq_mfextensions
v1_06_02
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 <boost/thread/mutex.hpp>
5
#include <queue>
6
#include "ErrorHandler/MessageAnalyzer/ma_types.h"
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
{
35
return
e1.timestamp() > e2.timestamp();
36
}
37
};
38
39
typedef
std::priority_queue<ma_timing_event, std::vector<ma_timing_event>,
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
}
// namespace errorhandler
58
}
// namespace novadaq
59
60
#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 Tue Jul 20 2021 16:36:31 for artdaq_mfextensions by
1.8.5