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>
26  public:
27  explicit StreamerInputModule(ParameterSet const& pset, InputSourceDescription const& desc);
28  ~StreamerInputModule() override;
29 
30  private:
31  void genuineCloseFile() override {
32  if (pr_.get() != nullptr)
33  pr_->closeFile();
34  }
35 
36  bool checkNextEvent() override;
37 
38  //ProductRegistry const* prod_reg_;
40  }; //end-of-class-def
41 
42  template <typename Producer>
44 
45  template <typename Producer>
47  : StreamerInputSource(pset, desc),
48  //prod_reg_(&productRegistry()),
49  pr_(new Producer(pset)) {
50  //Get header/init from Producer
51  InitMsgView const* header = pr_->getHeader();
53  }
54 
55  template <typename Producer>
57  EventMsgView const* eview = pr_->getNextEvent();
58 
59  if (pr_->newHeader()) {
60  FDEBUG(6) << "A new file has been opened and we must compare Headers here !!" << std::endl;
61  // A new file has been opened and we must compare Headers here !!
62  //Get header/init from Producer
63  InitMsgView const* header = pr_->getHeader();
64  deserializeAndMergeWithRegistry(*header, true);
65  }
66  if (eview == nullptr) {
67  return false;
68  }
69  deserializeEvent(*eview);
70  return true;
71  }
72 
73 } // namespace edm
74 
75 #endif
edm::propagate_const< std::unique_ptr< Producer > > pr_
StreamerInputModule(ParameterSet const &pset, InputSourceDescription const &desc)
void deserializeEvent(EventMsgView const &eventView)
element_type const * get() const
HLT enums.
#define FDEBUG(lev)
Definition: DebugMacros.h:19
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
void genuineCloseFile() override