1+ #ifndef FWCore_TestProcessor_TestSourceProcessor_h
2+ #define FWCore_TestProcessor_TestSourceProcessor_h
3+ // -*- C++ -*-
4+ //
5+ // Package: FWCore/TestProcessor
6+ // Class : TestSourceProcessor
7+ //
8+ /* *\class TestSourceProcessor TestSourceProcessor.h "TestSourceProcessor.h"
9+
10+ Description: Used for testing InputSources
11+
12+ Usage:
13+ <usage>
14+
15+ */
16+ //
17+ // Original Author: Chris Jones
18+ // Created: Mon, 30 Apr 2018 18:51:00 GMT
19+ //
20+ #include < string>
21+ #include < utility>
22+ #include < memory>
23+ #include " oneapi/tbb/global_control.h"
24+ #include " oneapi/tbb/task_arena.h"
25+ #include " oneapi/tbb/task_group.h"
26+
27+ #include " DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
28+
29+ #include " FWCore/Common/interface/FWCoreCommonFwd.h"
30+
31+ #include " FWCore/Framework/interface/HistoryAppender.h"
32+ #include " FWCore/Framework/interface/InputSource.h"
33+ #include " FWCore/Framework/interface/SharedResourcesAcquirer.h"
34+ #include " FWCore/Framework/interface/PrincipalCache.h"
35+ #include " FWCore/Framework/interface/SignallingProductRegistry.h"
36+ #include " FWCore/Framework/interface/PreallocationConfiguration.h"
37+ #include " FWCore/Framework/interface/MergeableRunProductProcesses.h"
38+
39+ #include " FWCore/ServiceRegistry/interface/ActivityRegistry.h"
40+ #include " FWCore/ServiceRegistry/interface/ProcessContext.h"
41+ #include " FWCore/ServiceRegistry/interface/ServiceLegacy.h"
42+ #include " FWCore/ServiceRegistry/interface/ServiceToken.h"
43+
44+ #include " FWCore/TestProcessor/interface/EventFromSource.h"
45+ #include " FWCore/TestProcessor/interface/LuminosityBlockFromSource.h"
46+ #include " FWCore/TestProcessor/interface/ProcessBlock.h"
47+ #include " FWCore/TestProcessor/interface/RunFromSource.h"
48+
49+ namespace edm ::test {
50+
51+ class TestSourceProcessor {
52+ public:
53+ TestSourceProcessor (std::string const & iConfig, ServiceToken iToken = ServiceToken());
54+ ~TestSourceProcessor ();
55+
56+ InputSource::ItemTypeInfo findNextTransition ();
57+
58+ std::shared_ptr<FileBlock> openFile ();
59+ void closeFile (std::shared_ptr<FileBlock>);
60+
61+ edm::test::RunFromSource readRun ();
62+
63+ edm::test::LuminosityBlockFromSource readLuminosityBlock ();
64+
65+ edm::test::EventFromSource readEvent ();
66+
67+ private:
68+ edm::InputSource::ItemTypeInfo lastTransition_;
69+
70+ oneapi::tbb::global_control globalControl_;
71+ oneapi::tbb::task_group taskGroup_;
72+ oneapi::tbb::task_arena arena_;
73+ std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
74+ std::shared_ptr<ProductRegistry> preg_;
75+ std::shared_ptr<BranchIDListHelper> branchIDListHelper_;
76+ std::shared_ptr<ProcessBlockHelper> processBlockHelper_;
77+ std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper_;
78+ ServiceToken serviceToken_;
79+
80+ std::shared_ptr<ProcessConfiguration const > processConfiguration_;
81+ ProcessContext processContext_;
82+ MergeableRunProductProcesses mergeableRunProductProcesses_;
83+
84+ ProcessHistoryRegistry processHistoryRegistry_;
85+ std::unique_ptr<HistoryAppender> historyAppender_;
86+
87+ PrincipalCache principalCache_;
88+ PreallocationConfiguration preallocations_;
89+
90+ std::unique_ptr<edm::InputSource> source_;
91+
92+ std::shared_ptr<RunPrincipal> runPrincipal_;
93+ std::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
94+
95+ std::shared_ptr<FileBlock> fb_;
96+ };
97+ } // namespace edm::test
98+
99+ #endif
0 commit comments