CMS 3D CMS Logo

StreamerInputFile.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputFile_h
2 #define IOPool_Streamer_StreamerInputFile_h
3 
10 
11 #include <memory>
12 
13 #include <string>
14 #include <vector>
15 
16 namespace edm {
17  class EventSkipperByID;
18  class FileCatalogItem;
20  public:
22  explicit StreamerInputFile(std::string const& name,
23  std::string const& LFN,
24  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
25  explicit StreamerInputFile(std::string const& name,
26  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
27 
29  explicit StreamerInputFile(std::vector<FileCatalogItem> const& names,
30  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
31 
33 
34  bool next();
36  InitMsgView const* startMessage() const { return startMsg_.get(); }
39  EventMsgView const* currentRecord() const { return currentEvMsg_.get(); }
42  bool newHeader() {
43  bool tmp = newHeader_;
44  newHeader_ = false;
45  return tmp;
46  }
48  void closeStreamerFile();
50 
51  private:
52  void openStreamerFile(std::string const& name, std::string const& LFN);
53  IOSize readBytes(char* buf, IOSize nBytes);
54  IOOffset skipBytes(IOSize nBytes);
55 
56  void readStartMessage();
57  int readEventMessage();
58 
59  bool openNextFile();
62  bool compareHeader();
63 
64  void logFileAction(char const* msg);
65 
68 
69  std::vector<char> headerBuf_;
70  std::vector<char> eventBuf_;
72  unsigned int currentFile_;
73  std::vector<FileCatalogItem> streamerNames_;
77 
79 
82 
83  bool newHeader_;
84 
86 
87  bool endOfFile_;
88  };
89 } // namespace edm
90 
91 #endif
std::vector< char > eventBuf_
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
const std::string names[nVars_]
void closeStreamerFile()
Needs to be public because of forking.
StreamerInputFile(std::string const &name, std::string const &LFN, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >())
IOOffset skipBytes(IOSize nBytes)
InitMsgView const * startMessage() const
element_type const * get() const
void openStreamerFile(std::string const &name, std::string const &LFN)
unsigned int uint32
Definition: MsgTools.h:13
void logFileAction(char const *msg)
IOSize readBytes(char *buf, IOSize nBytes)
tuple msg
Definition: mps_check.py:285
int64_t IOOffset
Definition: IOTypes.h:19
EventMsgView const * currentRecord() const
std::vector< char > headerBuf_
HLT enums.
edm::propagate_const< std::shared_ptr< EventMsgView > > currentEvMsg_
std::vector< FileCatalogItem > streamerNames_
size_t IOSize
Definition: IOTypes.h:14
edm::propagate_const< std::shared_ptr< InitMsgView > > startMsg_
tmp
align.sh
Definition: createJobs.py:716
edm::propagate_const< std::unique_ptr< Storage > > storage_