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  enum class Next { kEvent, kFile, kStop };
35  Next next();
37  InitMsgView const* startMessage() const { return startMsg_.get(); }
40  EventMsgView const* currentRecord() const { return currentEvMsg_.get(); }
43  bool newHeader() {
44  bool tmp = newHeader_;
45  newHeader_ = false;
46  return tmp;
47  }
49  void closeStreamerFile();
50  bool openNextFile();
51 
52  private:
53  void openStreamerFile(std::string const& name, std::string const& LFN);
54  IOSize readBytes(char* buf, IOSize nBytes);
55  IOOffset skipBytes(IOSize nBytes);
56 
57  void readStartMessage();
58  int readEventMessage();
59 
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
edm::StreamerInputFile::Next
Next
Definition: StreamerInputFile.h:34
edm::StreamerInputFile::newHeader_
bool newHeader_
Definition: StreamerInputFile.h:83
edm::StreamerInputFile::currProto_
uint32 currProto_
Definition: StreamerInputFile.h:81
propagate_const.h
edm::StreamerInputFile::openNextFile
bool openNextFile()
Definition: StreamerInputFile.cc:189
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::StreamerInputFile::readEventMessage
int readEventMessage()
Definition: StreamerInputFile.cc:223
edm::propagate_const::get
constexpr element_type const * get() const
Definition: propagate_const.h:64
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::StreamerInputFile::Next::kEvent
Storage.h
InitMessage.h
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::StreamerInputFile::skipBytes
IOOffset skipBytes(IOSize nBytes)
Definition: StreamerInputFile.cc:125
edm::StreamerInputFile::currentFileName_
std::string currentFileName_
Definition: StreamerInputFile.h:75
edm::StreamerInputFile::currentEvMsg_
edm::propagate_const< std::shared_ptr< EventMsgView > > currentEvMsg_
Definition: StreamerInputFile.h:67
edm::StreamerInputFile::streamerNames_
std::vector< FileCatalogItem > streamerNames_
Definition: StreamerInputFile.h:73
EventMsgView
Definition: EventMessage.h:72
uint32
unsigned int uint32
Definition: MsgTools.h:13
edm::StreamerInputFile::~StreamerInputFile
~StreamerInputFile()
Definition: StreamerInputFile.cc:19
edm::StreamerInputFile
Definition: StreamerInputFile.h:19
edm::propagate_const
Definition: propagate_const.h:32
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
edm::StreamerInputFile::newHeader
bool newHeader()
Definition: StreamerInputFile.h:43
edm::StreamerInputFile::storage_
edm::propagate_const< std::unique_ptr< Storage > > storage_
Definition: StreamerInputFile.h:85
edm::StreamerInputFile::startMsg_
edm::propagate_const< std::shared_ptr< InitMsgView > > startMsg_
Definition: StreamerInputFile.h:66
edm::StreamerInputFile::startMessage
InitMsgView const * startMessage() const
Definition: StreamerInputFile.h:37
edm::StreamerInputFile::compareHeader
bool compareHeader()
Definition: StreamerInputFile.cc:209
edm::StreamerInputFile::closeStreamerFile
void closeStreamerFile()
Definition: StreamerInputFile.cc:105
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
edm::StreamerInputFile::headerBuf_
std::vector< char > headerBuf_
Definition: StreamerInputFile.h:69
IOTypes.h
MsgTools.h
edm::StreamerInputFile::readStartMessage
void readStartMessage()
Definition: StreamerInputFile.cc:139
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
edm::StreamerInputFile::eventSkipperByID_
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: StreamerInputFile.h:78
edm::StreamerInputFile::Next::kStop
edm::StreamerInputFile::currRun_
uint32 currRun_
Definition: StreamerInputFile.h:80
edm::StreamerInputFile::Next::kFile
edm::StreamerInputFile::openStreamerFile
void openStreamerFile(std::string const &name, std::string const &LFN)
Definition: StreamerInputFile.cc:69
EventMessage.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::StreamerInputFile::next
Next next()
Definition: StreamerInputFile.cc:175
edm::StreamerInputFile::multiStreams_
bool multiStreams_
Definition: StreamerInputFile.h:74
edm::StreamerInputFile::endOfFile_
bool endOfFile_
Definition: StreamerInputFile.h:87
edm::StreamerInputFile::currentFile_
unsigned int currentFile_
Definition: StreamerInputFile.h:72
edm::StreamerInputFile::logFileAction
void logFileAction(char const *msg)
Definition: StreamerInputFile.cc:285
edm::StreamerInputFile::StreamerInputFile
StreamerInputFile(std::string const &name, std::string const &LFN, std::shared_ptr< EventSkipperByID > eventSkipperByID=std::shared_ptr< EventSkipperByID >())
Definition: StreamerInputFile.cc:21
edm::StreamerInputFile::readBytes
IOSize readBytes(char *buf, IOSize nBytes)
Definition: StreamerInputFile.cc:113
edm::StreamerInputFile::eventBuf_
std::vector< char > eventBuf_
Definition: StreamerInputFile.h:70
edm::StreamerInputFile::currentFileOpen_
bool currentFileOpen_
Definition: StreamerInputFile.h:76
IOSize
size_t IOSize
Definition: IOTypes.h:14
InitMsgView
Definition: InitMessage.h:61
edm::StreamerInputFile::currentRecord
EventMsgView const * currentRecord() const
Definition: StreamerInputFile.h:40