CMS 3D CMS Logo

StreamerInputModule.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputModule_h
2 #define IOPool_Streamer_StreamerInputModule_h
3 
5 
8 
9 #include <memory>
10 #include <string>
11 #include <fstream>
12 #include <vector>
13 #include <utility>
14 #include <iostream>
15 #include <algorithm>
16 #include <iterator>
17 
18 namespace edm {
19  template <typename Producer>
27  public:
29  ~StreamerInputModule() override;
30 
31  private:
32  void genuineCloseFile() override {
33  if (pr_.get() != nullptr)
34  pr_->closeFile();
35  }
36 
37  void genuineReadFile() override {
38  if (isFirstFile_) {
39  isFirstFile_ = false;
40  return;
41  }
42 
43  InitMsgView const* header = pr_->getHeader();
45  }
46 
47  Next checkNext() override;
48 
50  bool isFirstFile_ = true;
51  }; //end-of-class-def
52 
53  template <typename Producer>
55 
56  template <typename Producer>
59  //prod_reg_(&productRegistry()),
60  pr_(new Producer(pset)) {
61  //Get header/init from Producer
62  InitMsgView const* header = pr_->getHeader();
64  }
65 
66  template <typename Producer>
68  EventMsgView const* eview = pr_->getNextEvent();
69 
70  if (pr_->newHeader()) {
71  FDEBUG(6) << "A new file has been opened and we must compare Headers here !!" << std::endl;
72  return Next::kFile;
73  }
74  if (eview == nullptr) {
75  return Next::kStop;
76  }
77  deserializeEvent(*eview);
78  return Next::kEvent;
79  }
80 
81 } // namespace edm
82 
83 #endif
edm::StreamerInputModule
Definition: StreamerInputModule.h:20
edm::StreamerInputModule::genuineCloseFile
void genuineCloseFile() override
Definition: StreamerInputModule.h:32
propagate_const.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::StreamerInputModule::pr_
edm::propagate_const< std::unique_ptr< Producer > > pr_
Definition: StreamerInputModule.h:49
edm::StreamerInputSource
Definition: StreamerInputSource.h:31
edm::InputSourceDescription
Definition: InputSourceDescription.h:21
edm::propagate_const::get
constexpr element_type const * get() const
Definition: propagate_const.h:64
singlePfTauSkim_cff.Producer
Producer
Definition: singlePfTauSkim_cff.py:23
EventMsgView
Definition: EventMessage.h:72
edm::StreamerInputSource::deserializeAndMergeWithRegistry
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
Definition: StreamerInputSource.cc:167
edm::StreamerInputModule::isFirstFile_
bool isFirstFile_
Definition: StreamerInputModule.h:50
edm::StreamerInputModule::~StreamerInputModule
~StreamerInputModule() override
Definition: StreamerInputModule.h:54
edm::propagate_const
Definition: propagate_const.h:32
StreamerInputSource.h
edm::shared_memory::channel_names::kStop
constexpr char const *const kStop
Definition: channel_names.h:34
edm::ParameterSet
Definition: ParameterSet.h:47
FDEBUG
#define FDEBUG(lev)
Definition: DebugMacros.h:19
edm::RawInputSource::Next
Next
Definition: RawInputSource.h:24
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::StreamerInputModule::genuineReadFile
void genuineReadFile() override
Definition: StreamerInputModule.h:37
edm::StreamerInputModule::checkNext
Next checkNext() override
Definition: StreamerInputModule.h:67
edm::StreamerInputModule::StreamerInputModule
StreamerInputModule(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: StreamerInputModule.h:57
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
DebugMacros.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
InitMsgView
Definition: InitMessage.h:61