CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
lhef::LHEReader::FileSource Class Reference
Inheritance diagram for lhef::LHEReader::FileSource:
lhef::LHEReader::Source

Public Member Functions

XMLDocumentcreateReader (XMLDocument::Handler &handler) override
 
 FileSource (const std::string &fileURL)
 
 ~FileSource ()
 
- Public Member Functions inherited from lhef::LHEReader::Source
 Source ()
 
virtual ~Source ()
 

Private Attributes

std::auto_ptr< StorageWrapfileStream
 

Detailed Description

Definition at line 50 of file LHEReader.cc.

Constructor & Destructor Documentation

lhef::LHEReader::FileSource::FileSource ( const std::string &  fileURL)
inline

Definition at line 52 of file LHEReader.cc.

References Exception, StorageFactory::get(), eostools::move(), StorageFactory::open(), and IOFlags::OpenRead.

53  {
54  auto storage =
55  StorageFactory::get()->open(fileURL,
57 
58  if (!storage)
59  throw cms::Exception("FileOpenError")
60  << "Could not open LHE file \""
61  << fileURL << "\" for reading"
62  << std::endl;
63 
64  fileStream.reset(new StorageWrap(std::move(storage)));
65  }
static const StorageFactory * get(void)
std::auto_ptr< StorageWrap > fileStream
Definition: LHEReader.cc:73
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< Storage > open(const std::string &url, int mode=IOFlags::OpenRead) const
lhef::LHEReader::FileSource::~FileSource ( )
inline

Definition at line 67 of file LHEReader.cc.

67 {}

Member Function Documentation

XMLDocument* lhef::LHEReader::FileSource::createReader ( XMLDocument::Handler handler)
inlineoverridevirtual

Implements lhef::LHEReader::Source.

Definition at line 69 of file LHEReader.cc.

70  { return new XMLDocument(fileStream, handler); }
std::auto_ptr< StorageWrap > fileStream
Definition: LHEReader.cc:73
std::unique_ptr< XMLHandler > handler
Definition: LHEReader.h:45

Member Data Documentation

std::auto_ptr<StorageWrap> lhef::LHEReader::FileSource::fileStream
private

Definition at line 73 of file LHEReader.cc.