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;
19  public:
21  explicit StreamerInputFile(std::string const& name,
22  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
23 
25  explicit StreamerInputFile(std::vector<std::string> const& names,
26  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
27 
29 
30  bool next();
32  InitMsgView const* startMessage() const { return startMsg_.get(); }
35  EventMsgView const* currentRecord() const { return currentEvMsg_.get(); }
38  bool newHeader() {
39  bool tmp = newHeader_;
40  newHeader_ = false;
41  return tmp;
42  }
44  void closeStreamerFile();
46 
47  private:
48  void openStreamerFile(std::string const& name);
49  IOSize readBytes(char* buf, IOSize nBytes);
50  IOOffset skipBytes(IOSize nBytes);
51 
52  void readStartMessage();
53  int readEventMessage();
54 
55  bool openNextFile();
58  bool compareHeader();
59 
60  void logFileAction(char const* msg);
61 
64 
65  std::vector<char> headerBuf_;
66  std::vector<char> eventBuf_;
68  unsigned int currentFile_;
69  std::vector<std::string> streamerNames_;
73 
75 
78 
79  bool newHeader_;
80 
82 
83  bool endOfFile_;
84  };
85 } // namespace edm
86 
87 #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.
IOOffset skipBytes(IOSize nBytes)
std::vector< std::string > streamerNames_
InitMsgView const * startMessage() const
element_type const * get() const
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
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
EventMsgView const * currentRecord() const
std::vector< char > headerBuf_
HLT enums.
edm::propagate_const< std::shared_ptr< EventMsgView > > currentEvMsg_
size_t IOSize
Definition: IOTypes.h:14
edm::propagate_const< std::shared_ptr< InitMsgView > > startMsg_
StreamerInputFile(std::string const &name, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >())
void openStreamerFile(std::string const &name)
edm::propagate_const< std::unique_ptr< Storage > > storage_