CMS 3D CMS Logo

lhef::STLInputStream Class Reference

#include <GeneratorInterface/LHEInterface/src/XMLUtils.h>

List of all members.

Public Types

typedef std::istream Stream_t

Public Member Functions

virtual unsigned int curPos () const
virtual unsigned int readBytes (XMLByte *const buf, const unsigned int size)
 STLInputStream (std::istream &in)
virtual ~STLInputStream ()

Private Attributes

std::istream & in
unsigned int pos


Detailed Description

Definition at line 149 of file XMLUtils.h.


Member Typedef Documentation

typedef std::istream lhef::STLInputStream::Stream_t

Definition at line 151 of file XMLUtils.h.


Constructor & Destructor Documentation

lhef::STLInputStream::STLInputStream ( std::istream &  in  ) 

Definition at line 169 of file XMLUtils.cc.

References lat::endl().

00169                                              :
00170         in(in)
00171 {
00172         if (in.bad())
00173                 throw cms::Exception("FileStreamError")
00174                         << "I/O stream bad in STLInputStream::STLInputStream()"
00175                         << std::endl;
00176 }

lhef::STLInputStream::~STLInputStream (  )  [virtual]

Definition at line 178 of file XMLUtils.cc.

00179 {
00180 }


Member Function Documentation

virtual unsigned int lhef::STLInputStream::curPos (  )  const [inline, virtual]

Definition at line 156 of file XMLUtils.h.

References pos.

00156 { return pos; }

unsigned int lhef::STLInputStream::readBytes ( XMLByte *const   buf,
const unsigned int  size 
) [virtual]

Definition at line 182 of file XMLUtils.cc.

References lat::endl(), i, in, int, pos, and SiStripLorentzAngle_cfi::read.

00184 {
00185         char *rawBuf = reinterpret_cast<char*>(buf);
00186         unsigned int bytes = size * sizeof(XMLByte);
00187         in.read(rawBuf, bytes);
00188         unsigned int readBytes = in.gcount();
00189 
00190         if (in.bad())
00191                 throw cms::Exception("FileStreamError")
00192                         << "I/O stream bad in STLInputStream::readBytes()"
00193                         << std::endl;
00194 
00195         unsigned int read = (unsigned int)(readBytes / sizeof(XMLByte));
00196         unsigned int rest = (unsigned int)(readBytes % sizeof(XMLByte));
00197         for(unsigned int i = 1; i <= rest; i++)
00198                 in.putback(rawBuf[readBytes - i]);
00199 
00200         pos += read;
00201         return read;
00202 }


Member Data Documentation

std::istream& lhef::STLInputStream::in [private]

Definition at line 162 of file XMLUtils.h.

Referenced by readBytes().

unsigned int lhef::STLInputStream::pos [private]

Definition at line 163 of file XMLUtils.h.

Referenced by curPos(), and readBytes().


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