CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamerInputModule.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputModule_h
2 #define IOPool_Streamer_StreamerInputModule_h
3 
5 
7 
8 #include <memory>
9 #include <string>
10 #include <fstream>
11 #include <vector>
12 #include <utility>
13 #include <iostream>
14 #include <algorithm>
15 #include <iterator>
16 
17 namespace edm
18 {
19  template <typename Producer>
26  public:
27  explicit StreamerInputModule(ParameterSet const& pset,
28  InputSourceDescription const& desc);
29  virtual ~StreamerInputModule();
30  virtual EventPrincipal* read();
31 
32  private:
33  //ProductRegistry const* prod_reg_;
34  std::auto_ptr<Producer> pr_;
35  }; //end-of-class-def
36 
37  template <typename Producer>
39 
40  template <typename Producer>
42  ParameterSet const& pset,
43  InputSourceDescription const& desc):
44  StreamerInputSource(pset, desc),
45  //prod_reg_(&productRegistry()),
46  pr_(new Producer(pset)) {
47  //Get header/init from Producer
48  InitMsgView const* header = pr_->getHeader();
50  }
51 
52  template <typename Producer>
54 
55  EventMsgView const* eview = pr_->getNextEvent();
56 
57  if (pr_->newHeader()) {
58  FDEBUG(6) << "A new file has been opened and we must compare Headers here !!" << std::endl;
59  // A new file has been opened and we must compare Headers here !!
60  //Get header/init from Producer
61  InitMsgView const* header = pr_->getHeader();
62  deserializeAndMergeWithRegistry(*header, true);
63  }
64  if (eview == 0) {
65  return 0;
66  }
67  return(deserializeEvent(*eview));
68  }
69 
70 } // end of namespace-edm
71 
72 #endif
#define FDEBUG(lev)
Definition: DebugMacros.h:18
StreamerInputModule(ParameterSet const &pset, InputSourceDescription const &desc)
virtual EventPrincipal * read()
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
std::auto_ptr< Producer > pr_