CMS 3D CMS Logo

StreamerInputSource.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputSource_h
2 #define IOPool_Streamer_StreamerInputSource_h
3 
12 #include "TBufferFile.h"
13 
17 
20 
21 #include <memory>
22 #include <vector>
23 
24 class InitMsgView;
25 class EventMsgView;
26 
27 namespace edm {
28  class BranchIDListHelper;
30  class ThinnedAssociationsHelper;
31 
33  public:
34  explicit StreamerInputSource(ParameterSet const& pset,
35  InputSourceDescription const& desc);
36  ~StreamerInputSource() override;
38 
39  std::unique_ptr<SendJobHeader> deserializeRegistry(InitMsgView const& initView);
40 
41  void deserializeAndMergeWithRegistry(InitMsgView const& initView, bool subsequent = false);
42 
43  void deserializeEvent(EventMsgView const& eventView);
44 
45  static
50  bool subsequent);
51 
60  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
61  unsigned int inputSize,
62  std::vector<unsigned char>& outputBuffer,
63  unsigned int expectedFullSize);
64  protected:
65  static void declareStreamers(SendDescs const& descs);
66  static void buildClassCache(SendDescs const& descs);
67  void resetAfterEndRun();
68 
69  private:
70 
72  public:
74  ~EventPrincipalHolder() override;
75 
76  WrapperBase const* getIt(ProductID const& id) const override;
77  WrapperBase const* getThinnedProduct(ProductID const&, unsigned int&) const override;
78  void getThinnedProducts(ProductID const& pid,
79  std::vector<WrapperBase const*>& wrappers,
80  std::vector<unsigned int>& keys) const override;
81 
82 
83  unsigned int transitionIndex_() const override;
84 
86 
87  private:
88  // We don't own the principal. The lifetime must be managed externally.
90  };
91 
92  void read(EventPrincipal& eventPrincipal) override;
93 
94  void setRun(RunNumber_t r) override;
95 
96  std::unique_ptr<FileBlock> readFile_() override;
97 
99  std::vector<unsigned char> dest_;
100  TBufferFile xbuf_;
103  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipalHolder>>> streamToEventPrincipalHolders_;
105 
107  unsigned int protocolVersion_;
108  }; //end-of-class-def
109 } // end of namespace-edm
110 
111 #endif
void read(EventPrincipal &eventPrincipal) override
static void fillDescription(ParameterSetDescription &description)
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, ThinnedAssociationsHelper &, bool subsequent)
std::vector< BranchDescription > SendDescs
std::unique_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
void setRun(RunNumber_t r) override
std::unique_ptr< FileBlock > readFile_() override
static void declareStreamers(SendDescs const &descs)
static void buildClassCache(SendDescs const &descs)
edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > eventPrincipalHolder_
void deserializeEvent(EventMsgView const &eventView)
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &wrappers, std::vector< unsigned int > &keys) const override
edm::propagate_const< std::unique_ptr< SendEvent > > sendEvent_
WrapperBase const * getThinnedProduct(ProductID const &, unsigned int &) const override
WrapperBase const * getIt(ProductID const &id) const override
edm::propagate_const< TClass * > tc_
HLT enums.
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > > streamToEventPrincipalHolders_
unsigned int RunNumber_t
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
static unsigned int uncompressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize)
std::vector< unsigned char > dest_