lXDR Class Reference

#include <lXDR.hh>

Inheritance diagram for lXDR:

Inheritance graph
lStdHep
[legend]

List of all members.


Detailed Description

Light-weight XDR interface class.

Author:
Willy Langeveld

Definition at line 31 of file lXDR.hh.


Public Member Functions

 lXDR (const char *filename=0, bool open_for_write=false)
virtual ~lXDR ()
void setFileName (const char *filename, bool open_for_write=false)
const char * getFileName (void) const
long getError (void) const
long readLong (void)
double readFloat (void)
double readDouble (void)
const char * readString (long &length)
long * readLongArray (long &length)
double * readFloatArray (long &length)
double * readDoubleArray (long &length)
long writeLong (long data)
long writeDouble (double data)
long writeString (const char *data)
long writeString (const char *data, long length)
long writeLongArray (const long *data, long length)
long writeDoubleArray (const double *data, long length)
void setError (long error)
long filePosition (long pos=-1)

Static Public Member Functions

static int getMajor (void)
static int getMinor (void)
static const char * getText (void)

Private Types

enum  {
  MAJOR = 1, MINOR = 0, DAY = 23, MONTH = 10,
  YEAR = 2003
}

Private Member Functions

 lXDR (const lXDR &)
lXDRoperator= (const lXDR &)
double ntohd (double d) const
double htond (double d) const
long checkRead (long *)
long checkRead (float *)
long checkRead (double *)
long checkWrite (long *)
long checkWrite (double *)

Private Attributes

char * _fileName
FILE * _fp
long _error
bool _openForWrite
bool _hasNetworkOrder

Member Enumeration Documentation

anonymous enum [private]

Enumerator:
MAJOR 
MINOR 
DAY 
MONTH 
YEAR 

Definition at line 36 of file lXDR.hh.


Constructor & Destructor Documentation

lXDR::lXDR ( const char *  filename = 0,
bool  open_for_write = false 
)

Definition at line 38 of file lXDR.cc.

References _hasNetworkOrder, and setFileName().

lXDR::lXDR ( const lXDR  )  [private]

lXDR::~lXDR (  )  [virtual]

Definition at line 25 of file lXDR.cc.

References _fileName, and _fp.


Member Function Documentation

static int lXDR::getMajor ( void   )  [inline, static]

Reimplemented in lStdHep.

Definition at line 39 of file lXDR.hh.

References MAJOR.

static int lXDR::getMinor ( void   )  [inline, static]

Reimplemented in lStdHep.

Definition at line 40 of file lXDR.hh.

References MINOR.

static const char* lXDR::getText ( void   )  [inline, static]

Reimplemented in lStdHep.

Definition at line 41 of file lXDR.hh.

References DAY, MAJOR, MINOR, MONTH, and YEAR.

void lXDR::setFileName ( const char *  filename,
bool  open_for_write = false 
)

Definition at line 46 of file lXDR.cc.

References _error, _fileName, _fp, _openForWrite, LXDR_OPENFAILURE, and LXDR_SUCCESS.

Referenced by lXDR().

const char* lXDR::getFileName ( void   )  const [inline]

Definition at line 65 of file lXDR.hh.

References _fileName.

lXDR& lXDR::operator= ( const lXDR  )  [private]

long lXDR::getError ( void   )  const [inline]

Definition at line 75 of file lXDR.hh.

References _error.

Referenced by lStdHep::getEvent(), lStdHep::more(), slic::StdHepLoader::openStdHepFile(), lStdHep::Event::read(), lStdHep::EventTable::read(), lStdHep::readEvent(), lStdHep::readFileHeader(), and slic::StdHepLoader::readNextEvent().

long lXDR::readLong ( void   ) 

Definition at line 141 of file lXDR.cc.

References checkRead().

Referenced by lStdHep::Event::read(), lStdHep::EventTable::read(), and lStdHep::readFileHeader().

double lXDR::readFloat ( void   ) 

Definition at line 155 of file lXDR.cc.

References checkRead().

Referenced by lStdHep::Event::read().

double lXDR::readDouble ( void   ) 

Definition at line 148 of file lXDR.cc.

References checkRead().

Referenced by lStdHep::Event::read().

const char * lXDR::readString ( long &  length  ) 

Definition at line 162 of file lXDR.cc.

References _error, _fp, checkRead(), LXDR_READERROR, and LXDR_SUCCESS.

Referenced by lStdHep::Event::read(), lStdHep::EventTable::read(), and lStdHep::readFileHeader().

long * lXDR::readLongArray ( long &  length  ) 

Definition at line 177 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkRead(), LXDR_READERROR, and LXDR_SUCCESS.

Referenced by lStdHep::Event::read(), lStdHep::EventTable::read(), and lStdHep::readFileHeader().

double * lXDR::readFloatArray ( long &  length  ) 

Definition at line 205 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkRead(), LXDR_READERROR, and LXDR_SUCCESS.

double * lXDR::readDoubleArray ( long &  length  ) 

Definition at line 191 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkRead(), LXDR_READERROR, LXDR_SUCCESS, and ntohd().

Referenced by lStdHep::Event::read().

long lXDR::writeLong ( long  data  ) 

Definition at line 247 of file lXDR.cc.

References checkWrite().

long lXDR::writeDouble ( double  data  ) 

Definition at line 252 of file lXDR.cc.

References checkWrite().

long lXDR::writeString ( const char *  data  ) 

Definition at line 257 of file lXDR.cc.

long lXDR::writeString ( const char *  data,
long  length 
)

Definition at line 262 of file lXDR.cc.

References _error, _fp, checkWrite(), LXDR_SUCCESS, and LXDR_WRITEERROR.

long lXDR::writeLongArray ( const long *  data,
long  length 
)

Definition at line 271 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkWrite(), LXDR_SUCCESS, and LXDR_WRITEERROR.

long lXDR::writeDoubleArray ( const double *  data,
long  length 
)

Definition at line 285 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkWrite(), htond(), LXDR_SUCCESS, and LXDR_WRITEERROR.

void lXDR::setError ( long  error  )  [inline]

Definition at line 113 of file lXDR.hh.

References _error.

Referenced by lStdHep::lStdHep(), lStdHep::Event::read(), lStdHep::EventTable::read(), lStdHep::readEvent(), and lStdHep::readFileHeader().

long lXDR::filePosition ( long  pos = -1  ) 

Definition at line 300 of file lXDR.cc.

References _error, _fp, LXDR_NOFILE, and LXDR_SEEKERROR.

Referenced by lStdHep::readEvent().

double lXDR::ntohd ( double  d  )  const [private]

Definition at line 84 of file lXDR.cc.

References _hasNetworkOrder.

Referenced by checkRead(), htond(), and readDoubleArray().

double lXDR::htond ( double  d  )  const [inline, private]

Definition at line 127 of file lXDR.hh.

References ntohd().

Referenced by checkWrite(), and writeDoubleArray().

long lXDR::checkRead ( long *  l  )  [private]

Definition at line 107 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_READERROR, LXDR_READONLY, and LXDR_SUCCESS.

Referenced by readDouble(), readDoubleArray(), readFloat(), readFloatArray(), readLong(), readLongArray(), and readString().

long lXDR::checkRead ( float *  f  )  [private]

Definition at line 130 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_READERROR, LXDR_READONLY, and LXDR_SUCCESS.

long lXDR::checkRead ( double *  d  )  [private]

Definition at line 119 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_READERROR, LXDR_READONLY, LXDR_SUCCESS, and ntohd().

long lXDR::checkWrite ( long *  l  )  [private]

Definition at line 225 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_SUCCESS, LXDR_WRITEERROR, and LXDR_WRITEONLY.

Referenced by writeDouble(), writeDoubleArray(), writeLong(), writeLongArray(), and writeString().

long lXDR::checkWrite ( double *  d  )  [private]

Definition at line 236 of file lXDR.cc.

References _error, _fp, _openForWrite, htond(), LXDR_NOFILE, LXDR_SUCCESS, LXDR_WRITEERROR, and LXDR_WRITEONLY.


Member Data Documentation

char* lXDR::_fileName [private]

Definition at line 120 of file lXDR.hh.

Referenced by getFileName(), setFileName(), and ~lXDR().

FILE* lXDR::_fp [private]

Definition at line 121 of file lXDR.hh.

Referenced by checkRead(), checkWrite(), filePosition(), readDoubleArray(), readFloatArray(), readLongArray(), readString(), setFileName(), writeDoubleArray(), writeLongArray(), writeString(), and ~lXDR().

long lXDR::_error [private]

Definition at line 122 of file lXDR.hh.

Referenced by checkRead(), checkWrite(), filePosition(), getError(), readDoubleArray(), readFloatArray(), readLongArray(), readString(), setError(), setFileName(), writeDoubleArray(), writeLongArray(), and writeString().

bool lXDR::_openForWrite [private]

Definition at line 123 of file lXDR.hh.

Referenced by checkRead(), checkWrite(), and setFileName().

bool lXDR::_hasNetworkOrder [private]

Definition at line 125 of file lXDR.hh.

Referenced by lXDR(), ntohd(), readDoubleArray(), readFloatArray(), readLongArray(), writeDoubleArray(), and writeLongArray().


The documentation for this class was generated from the following files:
Generated on Thu Nov 15 15:24:35 2007 for Simulator for the Linear Collider by  doxygen 1.5.4