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 "boost/shared_ptr.hpp"
21 
22 #include <vector>
23 
24 class InitMsgView;
25 class EventMsgView;
26 
27 namespace edm {
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  EventPrincipal* deserializeEvent(EventMsgView const& eventView);
42 
43  static
44  void mergeIntoRegistry(SendJobHeader const& header, ProductRegistry&, 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 setEndRun() {runEndingFlag_ = true;}
62  void resetAfterEndRun();
63 
65 
66  private:
67 
68  class ProductGetter : public EDProductGetter {
69  public:
70  ProductGetter();
71  virtual ~ProductGetter();
72 
73  virtual WrapperHolder getIt(edm::ProductID const& id) const;
74 
76 
77  private:
78  // We don't own the principal. The lifetime must be managed externally.
80  };
81 
82  virtual EventPrincipal* read() = 0;
83 
84  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
85 
86  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
87 
88  virtual EventPrincipal*
89  readEvent_();
90 
91  virtual ItemType getNextItemType();
92 
93  virtual void setRun(RunNumber_t r);
94 
95  virtual boost::shared_ptr<FileBlock> readFile_();
96 
97  bool newRun_;
98  bool newLumi_;
100 
101  TClass* tc_;
102  std::vector<unsigned char> dest_;
103  TBufferFile xbuf_;
106 
107  //Do not like these to be static, but no choice as deserializeRegistry() that sets it is a static memeber
108  static std::string processName_;
109  static unsigned int protocolVersion_;
110  }; //end-of-class-def
111 } // end of namespace-edm
112 
113 #endif
static void fillDescription(ParameterSetDescription &description)
virtual WrapperHolder getIt(edm::ProductID const &id) const
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
std::vector< BranchDescription > SendDescs
virtual EventPrincipal * readEvent_()
static std::string processName_
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
virtual void setRun(RunNumber_t r)
virtual ItemType getNextItemType()
static void declareStreamers(SendDescs const &descs)
virtual EventPrincipal * read()=0
static void buildClassCache(SendDescs const &descs)
static unsigned int protocolVersion_
virtual boost::shared_ptr< FileBlock > readFile_()
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, bool subsequent)
tuple description
Definition: idDealer.py:66
EventPrincipal * deserializeEvent(EventMsgView const &eventView)
static std::auto_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
author Stefano ARGIRO author Bill Tanenbaum
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
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)
std::vector< unsigned char > dest_