CMS 3D CMS Logo

edm::StreamerFileReader Class Reference

#include <IOPool/Streamer/src/StreamerFileReader.h>

List of all members.

Public Member Functions

const InitMsgViewgetHeader ()
const EventMsgViewgetNextEvent ()
const bool newHeader ()
 StreamerFileReader (edm::ParameterSet const &pset)
 ~StreamerFileReader ()

Private Attributes

std::auto_ptr< StreamerInputFilestream_reader_
 names of Streamer files
std::vector< std::string > streamerNames_


Detailed Description

Definition at line 15 of file StreamerFileReader.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 30 of file StreamerFileReader.cc.

00031   {
00032   }


Member Function Documentation

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   }


Member Data Documentation

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]

Definition at line 27 of file StreamerFileReader.h.

Referenced by StreamerFileReader().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:44:23 2009 for CMSSW by  doxygen 1.5.4