-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlobalWatcher.h
75 lines (57 loc) · 2.21 KB
/
GlobalWatcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef Subsystem_Package_GlobalWatcher_h
#define Subsystem_Package_GlobalWatcher_h
// -*- C++ -*-
//
// Package: Package
// Class : GlobalWatcher
//
/**\class GlobalWatcher GlobalWatcher.h "GlobalWatcher.h"
Description: [one line class summary]
Usage:
<usage>
*/
//
// Original Author: Chris Jones
// Created: Thu, 30 May 2013 22:09:19 GMT
// $Id$
//
// system include files
#include <atomic>
// user include files
// forward declarations
class Run;
class Event;
class GlobalWatcher
{
public:
GlobalWatcher();
//virtual ~GlobalWatcher();
// ---------- const member functions ---------------------
void globalBeginRun(Run const&) const;
void globalEndRun(Run const&) const;
void beginStream(unsigned int) const;
void streamBeginRun(unsigned int, Run const&) const;
void event(unsigned int, Event const&) const;
void streamEndRun(unsigned int, Run const&) const;
void endStream(unsigned int) const;
unsigned int nEventsSeen() const { return m_nEventsSeen.load();}
unsigned int nBeginRunsSeen() const { return m_nBeginRunsSeen.load();}
unsigned int nEndRunsSeen() const { return m_nEndRunsSeen.load();}
unsigned int nBeginStreamsSeen() const { return m_nBeginStreamsSeen.load();}
unsigned int nEndStreamsSeen() const { return m_nEndStreamsSeen.load();}
// ---------- static member functions --------------------
// ---------- member functions ---------------------------
private:
GlobalWatcher(const GlobalWatcher&) = delete; // stop default
const GlobalWatcher& operator=(const GlobalWatcher&) = delete; // stop default
// ---------- member data --------------------------------
mutable std::atomic<unsigned int> m_simultaneousEvents{0};
mutable std::atomic<unsigned int> m_simultaneousBeginRuns{0};
mutable std::atomic<unsigned int> m_simultaneousEndRuns{0};
mutable std::atomic<unsigned int> m_nEventsSeen{0};
mutable std::atomic<unsigned int> m_nBeginRunsSeen{0};
mutable std::atomic<unsigned int> m_nEndRunsSeen{0};
mutable std::atomic<unsigned int> m_nBeginStreamsSeen{0};
mutable std::atomic<unsigned int> m_nEndStreamsSeen{0};
};
#endif