Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
canvas
canvas
test
Persistency
Common
MockRun.h
Go to the documentation of this file.
1
#ifndef canvas_test_Persistency_Common_MockRun_h
2
#define canvas_test_Persistency_Common_MockRun_h
3
4
#include "
canvas/Persistency/Common/Wrapper.h
"
5
6
#include <memory>
7
#include <utility>
8
#include <vector>
9
10
namespace
arttest
{
11
12
class
MockRun
{
13
public
:
14
template
<
typename
T
,
typename
... ARGS>
15
void
16
put
(ARGS&&...
args
)
17
{
18
auto
prod = std::make_unique<T>(std::forward<ARGS>(
args
)...);
19
products_
.push_back(
new
art::Wrapper<T>
(
std::move
(prod)));
20
}
21
22
template
<
typename
T>
23
T
24
get
()
const
25
{
26
// Retrieve and aggregate the products
27
auto
result
=
static_cast<
art::Wrapper<T>
&
>
(*
products_
[0]);
28
for
(
auto
it =
products_
.cbegin() + 1,
e
=
products_
.cend(); it !=
e
;
29
++it) {
30
result
.combine(*it);
31
}
32
return
*
result
.product();
33
}
34
35
private
:
36
std::vector<art::EDProduct*>
products_
;
37
};
38
}
39
40
#endif
/* canvas_test_Persistency_Common_MockRun_h */
41
42
// Local variables:
43
// mode: c++
44
// End:
Wrapper.h
result
static QCString result
Definition:
fortranscanner.cpp:56614
ValidateOpDetSimulation.T
T
Definition:
ValidateOpDetSimulation.py:52
arttest::MockRun
Definition:
MockRun.h:12
args
static QCString args
Definition:
declinfo.cpp:674
e
const double e
Definition:
gUpMuFluxGen.cxx:165
wirecell.gen.depos.move
def move(depos, offset)
Definition:
depos.py:107
arttest
Definition:
GroupSelector_t.h:4
arttest::MockRun::put
void put(ARGS &&...args)
Definition:
MockRun.h:16
art::Wrapper
Definition:
Handle.h:58
arttest::MockRun::products_
std::vector< art::EDProduct * > products_
Definition:
MockRun.h:36
Generated by
1.8.11