CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
16 
19 
20 #include <memory>
21 #include <vector>
22 
23 class InitMsgView;
24 class EventMsgView;
25 
26 namespace edm {
27  class BranchIDListHelper;
30  public:
31  explicit StreamerInputSource(ParameterSet const& pset,
32  InputSourceDescription const& desc);
33  virtual ~StreamerInputSource();
35 
36  static
37  std::auto_ptr<SendJobHeader> deserializeRegistry(InitMsgView const& initView);
38 
39  void deserializeAndMergeWithRegistry(InitMsgView const& initView, bool subsequent = false);
40 
41  void deserializeEvent(EventMsgView const& eventView);
42 
43  static
44  void mergeIntoRegistry(SendJobHeader const& header, ProductRegistry&, BranchIDListHelper&, bool subsequent);
45 
54  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
55  unsigned int inputSize,
56  std::vector<unsigned char>& outputBuffer,
57  unsigned int expectedFullSize);
58  protected:
59  static void declareStreamers(SendDescs const& descs);
60  static void buildClassCache(SendDescs const& descs);
61  void resetAfterEndRun();
62 
63  private:
64 
65  class ProductGetter : public EDProductGetter {
66  public:
67  ProductGetter();
68  virtual ~ProductGetter();
69 
70  virtual WrapperHolder getIt(edm::ProductID const& id) const;
71 
73 
74  private:
75  // We don't own the principal. The lifetime must be managed externally.
77  };
78 
79  virtual EventPrincipal* read(EventPrincipal& eventPrincipal);
80 
81  virtual void setRun(RunNumber_t r);
82 
83  virtual std::unique_ptr<FileBlock> readFile_();
84 
85  TClass* tc_;
86  std::vector<unsigned char> dest_;
87  TBufferFile xbuf_;
88  std::unique_ptr<SendEvent> sendEvent_;
91 
92  //Do not like these to be static, but no choice as deserializeRegistry() that sets it is a static memeber
94  static unsigned int protocolVersion_;
95  }; //end-of-class-def
96 } // end of namespace-edm
97 
98 #endif
static void fillDescription(ParameterSetDescription &description)
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, bool subsequent)
virtual WrapperHolder getIt(edm::ProductID const &id) const
std::vector< BranchDescription > SendDescs
static std::string processName_
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
virtual void setRun(RunNumber_t r)
static void declareStreamers(SendDescs const &descs)
static void buildClassCache(SendDescs const &descs)
std::unique_ptr< SendEvent > sendEvent_
static unsigned int protocolVersion_
void deserializeEvent(EventMsgView const &eventView)
virtual EventPrincipal * read(EventPrincipal &eventPrincipal)
tuple description
Definition: idDealer.py:66
static std::auto_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
unsigned int RunNumber_t
Definition: EventRange.h:32
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)
virtual std::unique_ptr< FileBlock > readFile_()
std::vector< unsigned char > dest_