CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

lhef::StorageInputStream Class Reference

#include <XMLUtils.h>

List of all members.

Public Types

typedef StorageWrap Stream_t

Public Member Functions

virtual unsigned int curPos () const
virtual unsigned int readBytes (XMLByte *const buf, const unsigned int size)
 StorageInputStream (StorageWrap &in)
virtual ~StorageInputStream ()

Private Attributes

StorageWrapin
unsigned int pos

Detailed Description

Definition at line 166 of file XMLUtils.h.


Member Typedef Documentation

Definition at line 169 of file XMLUtils.h.


Constructor & Destructor Documentation

lhef::StorageInputStream::StorageInputStream ( StorageWrap in)

Definition at line 205 of file XMLUtils.cc.

                                                      :
        in(in)
{
}
lhef::StorageInputStream::~StorageInputStream ( ) [virtual]

Definition at line 210 of file XMLUtils.cc.

{
}

Member Function Documentation

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

Definition at line 174 of file XMLUtils.h.

References pos.

{ return pos; }
unsigned int lhef::StorageInputStream::readBytes ( XMLByte *const  buf,
const unsigned int  size 
) [virtual]

Definition at line 214 of file XMLUtils.cc.

References Storage::CURRENT, in, pos, and SiPixelLorentzAngle_cfi::read.

{
        void *rawBuf = reinterpret_cast<void*>(buf);
        unsigned int bytes = size * sizeof(XMLByte);
        unsigned int readBytes = in->read(rawBuf, bytes);

        unsigned int read = (unsigned int)(readBytes / sizeof(XMLByte));
        unsigned int rest = (unsigned int)(readBytes % sizeof(XMLByte));
        if (rest)
                in->position(-(IOOffset)rest, Storage::CURRENT);

        pos += read;
        return read;
}

Member Data Documentation

Definition at line 180 of file XMLUtils.h.

Referenced by readBytes().

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

Definition at line 181 of file XMLUtils.h.

Referenced by curPos(), and readBytes().