Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
canvas
canvas
Persistency
Common
HLTPathStatus.cc
Go to the documentation of this file.
1
#include "
canvas/Persistency/Common/HLTPathStatus.h
"
2
// vim: set sw=2 expandtab :
3
4
#include "
canvas/Persistency/Common/HLTenums.h
"
5
#include "
cetlib/pow.h
"
6
7
#include <cassert>
8
#include <cstddef>
9
#include <cstdint>
10
11
namespace
{
12
constexpr
auto
path_size [[maybe_unused]] = cet::pow<14, size_t>(2);
13
}
14
15
namespace
art
{
16
17
HLTPathStatus::~HLTPathStatus
() =
default
;
18
HLTPathStatus::HLTPathStatus
() =
default
;
19
20
HLTPathStatus::HLTPathStatus
(
hlt::HLTState
const
state)
21
:
HLTPathStatus
{
state
, 0}
22
{}
23
24
HLTPathStatus::HLTPathStatus
(
hlt::HLTState
const
state
,
size_t
const
index
)
25
:
status_
{
26
static_cast<
std::uint16_t
>
(index << 2 | static_cast<size_t>(
state
))}
27
{
28
assert(state <
hlt::HLTState::N_STATES
);
29
assert(index < path_size);
30
}
31
32
hlt::HLTState
33
HLTPathStatus::state
()
const
34
{
35
return
static_cast<
hlt::HLTState
>
(
status_
& 0x03);
36
}
37
38
unsigned
39
HLTPathStatus::index
()
const
40
{
41
return
static_cast<
unsigned
>
(
status_
>> 2);
42
}
43
44
void
45
HLTPathStatus::reset
()
46
{
47
status_
= 0;
48
}
49
50
bool
51
HLTPathStatus::wasrun
()
const
52
{
53
return
state
() !=
hlt::Ready
;
54
}
55
56
bool
57
HLTPathStatus::accept
()
const
58
{
59
return
!
wasrun
() || (
state
() ==
hlt::Pass
);
60
}
61
62
bool
63
HLTPathStatus::error
()
const
64
{
65
return
state
() ==
hlt::Exception
;
66
}
67
68
}
// namespace art
art::HLTPathStatus
Definition:
HLTPathStatus.h:31
art::HLTPathStatus::error
bool error() const
Definition:
HLTPathStatus.cc:63
art::HLTPathStatus::wasrun
bool wasrun() const
Definition:
HLTPathStatus.cc:51
pow.h
art::hlt::HLTState
HLTState
Definition:
HLTenums.h:6
art::HLTPathStatus::reset
void reset()
Definition:
HLTPathStatus.cc:45
art::HLTPathStatus::~HLTPathStatus
~HLTPathStatus()
art::HLTPathStatus::index
unsigned int index() const
Definition:
HLTPathStatus.cc:39
art::hlt::Ready
Definition:
HLTenums.h:7
art::hlt::Exception
Definition:
HLTenums.h:10
art::HLTPathStatus::HLTPathStatus
HLTPathStatus()
art::HLTPathStatus::accept
bool accept() const
Definition:
HLTPathStatus.cc:57
HLTenums.h
art::hlt::N_STATES
Definition:
HLTenums.h:11
art
Definition:
BasicOptionsHandler.h:9
art::HLTPathStatus::status_
std::uint16_t status_
Definition:
HLTPathStatus.h:58
art::hlt::Pass
Definition:
HLTenums.h:8
art::HLTPathStatus::state
hlt::HLTState state() const
Definition:
HLTPathStatus.cc:33
HLTPathStatus.h
Generated by
1.8.11