#include <IOPool/Streamer/src/StreamerFileReader.h>
Public Member Functions | |
const InitMsgView * | getHeader () |
const EventMsgView * | getNextEvent () |
const bool | newHeader () |
StreamerFileReader (edm::ParameterSet const &pset) | |
~StreamerFileReader () | |
Private Attributes | |
std::auto_ptr< StreamerInputFile > | stream_reader_ |
names of Streamer files | |
std::vector< std::string > | streamerNames_ |
Definition at line 15 of file StreamerFileReader.h.
edm::StreamerFileReader::StreamerFileReader | ( | edm::ParameterSet const & | pset | ) |
Definition at line 11 of file StreamerFileReader.cc.
References TestMuL1L2Filter_cff::catalog, edm::InputFileCatalog::fileNames(), edm::errors::FileReadError, stream_reader_, and streamerNames_.
00011 : 00012 streamerNames_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames")) 00013 { 00014 PoolCatalog poolcat; 00015 InputFileCatalog catalog(pset, poolcat); 00016 streamerNames_ = catalog.fileNames(); 00017 00018 if (streamerNames_.size() > 1) 00019 stream_reader_ = std::auto_ptr<StreamerInputFile> 00020 (new StreamerInputFile(streamerNames_)); 00021 else if (streamerNames_.size() == 1) 00022 stream_reader_ = std::auto_ptr<StreamerInputFile> 00023 (new StreamerInputFile(streamerNames_.at(0))); 00024 else { 00025 throw edm::Exception(errors::FileReadError, "StreamerFileReader::StreamerFileReader") 00026 << " Not provided fileNames \n"; 00027 } 00028 }
edm::StreamerFileReader::~StreamerFileReader | ( | ) |
const InitMsgView * edm::StreamerFileReader::getHeader | ( | ) |
Definition at line 38 of file StreamerFileReader.cc.
References InitMsgView::code(), edm::errors::FileReadError, header, Header::INIT, and stream_reader_.
00039 { 00040 00041 const InitMsgView* header = stream_reader_->startMessage(); 00042 00043 if(header->code() != Header::INIT) //INIT Msg 00044 throw edm::Exception(errors::FileReadError, "StreamerFileReader::readHeader") 00045 << "received wrong message type: expected INIT, got " 00046 << header->code() << "\n"; 00047 00048 return header; 00049 }
const EventMsgView * edm::StreamerFileReader::getNextEvent | ( | ) |
Definition at line 51 of file StreamerFileReader.cc.
References stream_reader_.
00052 { 00053 if (!stream_reader_->next() ) 00054 { 00055 return 0; 00056 } 00057 return stream_reader_->currentRecord(); 00058 }
const bool edm::StreamerFileReader::newHeader | ( | ) |
Definition at line 34 of file StreamerFileReader.cc.
References stream_reader_.
00034 { 00035 return stream_reader_->newHeader(); 00036 }
std::auto_ptr<StreamerInputFile> edm::StreamerFileReader::stream_reader_ [private] |
names of Streamer files
Definition at line 28 of file StreamerFileReader.h.
Referenced by getHeader(), getNextEvent(), newHeader(), and StreamerFileReader().
std::vector<std::string> edm::StreamerFileReader::streamerNames_ [private] |