CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
20 
22  explicit StreamerInputFile(std::string const& name,
23  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
24 
26  explicit StreamerInputFile(std::vector<std::string> const& names,
27  std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
28 
30 
31  bool next();
33  InitMsgView const* startMessage() const { return startMsg_.get(); }
36  EventMsgView const* currentRecord() const { return currentEvMsg_.get(); }
39  bool newHeader() { bool tmp = newHeader_; newHeader_ = false; return tmp;}
41  void closeStreamerFile();
43 
44  private:
45 
46  void openStreamerFile(std::string const& name);
47  IOSize readBytes(char* buf, IOSize nBytes);
48  IOOffset skipBytes(IOSize nBytes);
49 
50  void readStartMessage();
51  int readEventMessage();
52 
53  bool openNextFile();
56  bool compareHeader();
57 
58  void logFileAction(char const* msg);
59 
62 
63  std::vector<char> headerBuf_;
64  std::vector<char> eventBuf_;
66  unsigned int currentFile_;
67  std::vector<std::string> streamerNames_;
71 
73 
76 
77  bool newHeader_;
78 
80 
81  bool endOfFile_;
82  };
83 }
84 
85 #endif
std::vector< char > eventBuf_
static const HistoName names[]
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
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)
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_
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_