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::propagate_const< std::unique_ptr< Producer > > pr_
constexpr char const *const kStop
Definition: channel_names.h:34
#define FDEBUG(lev)
Definition: DebugMacros.h:19
StreamerInputModule(ParameterSet const &pset, InputSourceDescription const &desc)
constexpr element_type const * get() const
HLT enums.
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
void genuineCloseFile() override