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 FWCore_TestProcessor_Event_h
#define FWCore_TestProcessor_Event_h
// -*- C++ -*-
//
// Package: FWCore/TestProcessor
// Class : Event
//
/**\class Event Event.h "Event.h"
Description: [one line class summary]
Usage:
<usage>
*/
//
// Original Author: Chris Jones
// Created: Mon, 30 Apr 2018 18:51:27 GMT
//
// system include files
#include <string>
// user include files
#include "FWCore/TestProcessor/interface/TestHandle.h"
#include "FWCore/Framework/interface/EventPrincipal.h"
#include "FWCore/Utilities/interface/TypeID.h"
// forward declarations
namespace edm {
class EventPrincipal;
namespace test {
class Event {
public:
Event(EventPrincipal const& iPrincipal, std::string iModuleLabel, std::string iProcessName, bool modulePassed);
// ---------- const member functions ---------------------
template <typename T>
TestHandle<T> get() const {
static const std::string s_null;
return get<T>(s_null);
}
template <typename T>
TestHandle<T> get(std::string const& iInstanceLabel) const {
auto h = principal_->getByLabel(
edm::PRODUCT_TYPE, edm::TypeID(typeid(T)), label_, iInstanceLabel, processName_, nullptr, nullptr, nullptr);
if (h.failedToGet()) {
return TestHandle<T>(std::move(h.whyFailedFactory()));
}
void const* basicWrapper = h.wrapper();
assert(basicWrapper);
Wrapper<T> const* wrapper = static_cast<Wrapper<T> const*>(basicWrapper);
return TestHandle<T>(wrapper->product());
}
bool modulePassed() const { return modulePassed_; }
// ---------- static member functions --------------------
// ---------- member functions ---------------------------
private:
// ---------- member data --------------------------------
EventPrincipal const* principal_;
std::string label_;
std::string processName_;
bool modulePassed_;
};
} // namespace test
} // namespace edm
#endif
|